in reply to Re: xml request
in thread xml request

sorry about any mess, so far I see no syntax error,but I poste the code again. Thanks for your help by the way!! What happens is when I send the request that it seems that the xml string is not being passed on and the response I get is as if I sent the request without the string
#!/usr/bin/perl use LWP::UserAgent; use HTTP::Request::Common; my $URL = "url.com"; # The xml_request my $xml_req = " <Row> <Address>H</Address> <Name>MUSTER/MAX</Name> <Age>34</Age> </Row>"; my $ua = LWP::UserAgent->new(); my $result = $ua->request(POST $URL,["form_param" => $xml_req]); print "Content-type: text/plain\n\n"; print $result->as_string(); print $result->content();

Replies are listed 'Best First'.
Re: Re: Re: xml request
by fruiture (Curate) on Aug 04, 2002 at 17:09 UTC

    Again: enable strict and warnings, especially when you're looking for a bug!

    The code should work now. But let's do some debugging:

    #$URL and $xml_req initialised print "Content-type: text/plain\r\n\r\n"; #rather use CGI.pm anyway print "URL: $URL\nXML: $xml_req\n-----\n"; my $ua = LWP::UserAgent->new(); print "Useragent: $ua\n"; #will print reference representation my $req = POST $URL,['form_param'=>$xml_req]; print "Request:\n",$req->as_string(),"\n-----\n"; my $result = $ua->request($req); # rest is clear...

    The problem is the generated Request (speculation). You can be sure after reading the documentation of HTTP::Request::Common

    --
    http://fruiture.de
      Well lets see, the idea is to send this server an xml request which will trigger this server to deliver a response then to capture the response and then carry on with that.. but you are right, the server does not reckognize the sent xml part.. Oh dear..