drohr has asked for the wisdom of the Perl Monks concerning the following question:
here is my test code that I am trying to use:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <label name="someLabel"/>
when I run this, I get the following error message:use LWP::UserAgent; my $urlRequest = "http://bamboohost/rest/api/latest/result/projectname +-planname-latest/label"; my $message = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"y +es\"?><label name=\"testlabel\"/>"; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new( POST => "$urlRequest"); $req->authorization_basic("username", "password"); $req->content($message); my $result = $ua->request( $req );
am I sending the xml payload properly? what am I missing here?The server refused this request because the request entity is in a for +mat not supported by the requested resource for the requested method.
use LWP::UserAgent; my $urlRequest = "http://bamboohost/rest/api/latest/result/projectname +-planname-latest/label"; my $message = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"y +es\"?><label name=\"testlabel\"/>"; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new( POST => "$urlRequest"); $req->authorization_basic("username", "password"); $req->content($message); $req->content_type('application/xml'); my $result = $ua->request( $req );
thanks,
|
|---|