in reply to Re: Question: Send a chunk of XML to a server
in thread Question: Send a chunk of XML to a server

But I can not change the server-side code which was written in PHP by other developers, and they wanted me to send exactly that XML data to the server. sounds to me that it can not be handled by a form POST.
  • Comment on Re^2: Question: Send a chunk of XML to a server

Replies are listed 'Best First'.
Re^3: Question: Send a chunk of XML to a server
by ikegami (Patriarch) on Nov 09, 2009 at 19:11 UTC

    I was trying to save you some trouble writing the server. Since that's already done, just use

    my $response = $ua->post( 'http://...', Content_Type => 'application/xml', Content => $xml, );
    Or if you need to twiddle with the request object,
    use HTTP::Common::Request qw( POST ); my $request = POST( "http://...", Content_Type => 'application/xml', Content => $xml, ); my $response = $ua->request($request);

    sounds to me that it can not be handled by a form POST.

    Of course you can't avoid using a form by using a form. I fail to see your point.