On Thu, 30 Oct 2003, Poly wrote:

> Rod,
> If you are not sure about the URL/URI, you could use the one below to 
> see if your data is getting to the other side.  I use it often to debug 
> my HTTP POST issues:
> http://www.polystreet.com/cgi-bin/testformpost.pl

Thanks I'll look into this.  This will help a little later (see below).

> Also, the most common issue I have seen with XML via HTTP POST is that 
> you expect to do a traditional form post of a name=value pair.  Say 
> $xdata is your whole xml document in one string, you can have:

Though I'm new to doing this I've read quite a bit on XML and even the
'application' developers got this little bit of information correct in the
documentation.
   I didn't fall for it, though the other method I was trying (before the 
upgrade broke it) used forms and for a few minutes I tried to figure out 
what I needed to do to translate.

> use HTTP::Request::Common qw(POST);
> use LWP::UserAgent;
> 
> $aurl='http://www.polystreet.com/cgi-bin/testformpost.pl';
> # some code to create your $xdata ...
> 
> $ua=LWP::UserAgent->new;
> my $req=POST $aurl,[xmldata=>$xdata];
> my $response=$ua->request($req);
> 
> meanwhile most xml applications expect the xml only, so you will have 
> to do something like:

As this one does... Well so they claim.

> use LWP::UserAgent;  #No need for Common to encode anything
> 
> $aurl='http://www.polystreet.com/cgi-bin/testformpost.pl';
> # some code to create your $xdata ...
> 
> my $req = HTTP::Request->new(POST => $aurl);
> $req->header('Content-Type' => 'text/xml; charset=UTF-8', 'Content-
> Transfer-Encoding' => '7bit', 'Content-Description' 
> => 'Document');
> $req->content($xdata);
> my $response = $ua->request($req);
> 
> Thanks,

My thanks to you.  This clarifies some of the concepts I was still 
struggling with.

I am still trying to find out what the URL is suppose to be.  Btw, their 
web page says implies it is open source but I have as yet to see the 
source code or find it in the registered/secured customer area of their 
web site.  If I had it I'm sure I could find an answer.


Again thanks,
Rod
-- 
  "Open Source Software - Sometimes you get more than you paid for..."

Reply via email to