in reply to Re: Help with HTTP POST xml file
in thread Help with HTTP PUT xml file

It actually needs to be a put. So im trying the below, but getting a 401 rejection even though it's basic auth. Is there a specific Mod I need to call for basic auth?
use LWP::UserAgent; use HTTP::Request::Common; use URI::Escape qw( uri_escape ); use File::Slurp; use LWP::Debug qw(+); use Data::Dumper; my $uid = "id"; my $upw = "pass"; my $message = read_file( '/tmp/1.xml' ) ; my $ua = LWP::UserAgent->new(agent => 'perl put'); $ua->credentials('host.com:80', '', $uid, $upw); my $response = $ua->request(PUT 'http://host.com', Content_Type => 'text/xml', Content => $message); print $response->error_as_HTML unless $response->is_success; print $response->content();