[rt-users] ruby -> REST

Tom Lahti toml at bitstatement.net
Mon Feb 16 21:43:59 EST 2009

> no value sent for required parameter 'changes'
> Stack:
>   [/opt/rt38/share/html/REST/1.0/dhandler:285]
>   [/opt/rt38/share/html/REST/1.0/autohandler:54]
>   [/opt/rt38/share/html/autohandler:311]

I seem to have figured this out.  You can use
application/x-www-form-urlencoded, but you have to create a single form
field named "content", and it must contain the entire form in RFC822 format.

I didn't really see that documented anywhere I was looking, so perhaps the
documentation is somewhat lacking.

For example, where I had this:

req.set_form_data( { "Action" => "comment",
                     "Text" => "This is some text" } )

I changed to this:

req.set_form_data( { "content" => "Action: comment\nText: This is some text" })

and it works as desired.

For the "Text" parameter in the content, if you want to add a multi-line
comment it seems you have to have white-space at the beginning of
continuation lines, otherwise the RT "form parser" in the REST interface
thinks its a syntax error; any line with a character in the first column is
expected to be a field name within the form.

It also seems bizarre to me to implement the interface that way.  Basically
its like making a web page with a single text area named "content" and then
requiring formatting within that one field.  Why not have the REST interface
have discrete fields?  Coding to it would be certainly be cleaner.  Maybe
for /REST/2.0/ ? :)

-- ============================
   Tom Lahti
   BIT Statement LLC

   (425)251-0833 x 117
-- ============================

More information about the RT-Users mailing list