[rt-users] ruby -> REST

Tom Lahti toml at bitstatement.net
Mon Feb 16 18:36:38 EST 2009


Tom Lahti wrote:
> I am working on some code in ruby that accesses the REST interface.

I've re-written the whole thing using the rest_client ruby gem, and
essentially the same results, but I get more info out of what's going on:

# ./resttest2.rb
--------------------- Request headers
{"User-Agent"=>"Mozilla/5.0 fake 0.1",
 "Content-Type"=>"application/x-www-form-urlencoded",
 :content_type=>"application/x-www-form-urlencoded",
 "Cookie"=>"RT_SID_xxxx.net.443=[a_hex_session_id]"}
--------------------- Request payload
"Ticket=846&Text=This%20is%20yet%20another%20test."
=====================
--------------------- Response headers
{:server=>
  "Apache/[snip] mod_perl/2.0.3 Perl/v5.8.8",
 :date=>"Mon, 16 Feb 2009 23:24:29 GMT",
 :transfer_encoding=>"chunked",
 :content_type=>"text/plain; charset=utf-8"}
--------------------- Response Payload
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]


Is it permissible to POST to the REST interface using content type
application/x-www-form-urlencoded?  It would seem that the RT CLI does
something else but its difficult for me to figure out what.

Should I be asking about this on rt-devel instead?

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

   (425)251-0833 x 117
   http://www.bitstatement.net/
-- ============================



More information about the rt-users mailing list