[rt-users] Getting a HTTP POST to return info on the created ticket

Thomas Sibley trs at bestpractical.com
Tue Apr 17 14:35:53 EDT 2012


On 04/17/2012 10:22 AM, Fergus McMenemie wrote:
> Hmm, not sure. I thought I was using the POST interface. As far as RT
> is concerned is POST The same as REST?

POST is a generic HTTP verb, not an interface.  You're POSTing (making
an HTTP request) to the normal RT self service pages designed for end
users, not custom scripts.

You probably want to use the REST endpoints RT provides, otherwise you
get to parse the response headers or HTML for the ticket number and errors.

http://wiki.bestpractical.com/view/REST

>     my $ua = LWP::UserAgent->new;
>     $ua->credentials( $RThost, 'OUR Internal Request System', $RTusername, $RTpassword );
>     my $response = $ua->post(
>         "http://$RThost/SelfService/Create.html",
[snip]

Have you looked at $response->decoded_content?  Read `perldoc
HTTP::Response` for what $response is.



More information about the rt-users mailing list