I think perhaps there was a confluence of almost right in the advice, try this mix (default auth headers like I showed before are more convenient because you only do it once)–
use strict; # Never- use warnings; # -skip these. use LWP::UserAgent; my $urlRequest = "http://bamboohost/rest/api/latest/result/projectname +-planname-latest/label"; my $xml = <<''; <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <label name="testlabel"/> my $ua = LWP::UserAgent->new; my $post = HTTP::Request->new( POST => $urlRequest ); $post->authorization_basic("username", "password"); $post->content($xml); $post->content_type("application/xml"); print $post->as_string; my $result = $ua->request( $post );
In reply to Re^5: Need help with sending xml formatted payload using HTTP::Request
by Your Mother
in thread Need help with sending xml formatted payload using HTTP::Request
by drohr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |