Selon Upayavira <[EMAIL PROTECTED]>:

> [EMAIL PROTECTED] wrote:
> 
> #!/usr/bin/perl
> 
> use LWP::UserAgent;
> 
> my $userAgent=LWP::UserAgent->new();
> my $response=$userAgent->get("http://localhost:8080/cocoon/your_url";);
> open(out, ">file.txt");
> print out $response->content;
> close(out);
> 
> Thus, you've asked perl to go get a page from Cocoon by HTTP, and then 
> written it to disk. The pipeline can just look for the file where the 
> FTP put it.
> 
> If you do want to post by HTTP, here's some code:
> 
> #!/usr/bin/perl
> 
> use LWP 5.64;
> 
> my $content = "<xml>Some XML</xml>";
> my $request = HTTP::Request->new("POST");
> 
> $request->header("Content-Type","text/xml");
> $request->content($content);
> $request->url("http://yourserver/cocoon/url";);
> 
> my $ua = LWP::UserAgent->new;
> my $response = $ua->request($request);
> 
> if ($response->is_success) {
>   print $response->content,"\n";
> } else {
>   print "ERROR: ",$response->status_line,"\n";
> }
> 
> Does this help?

Yes, it does! :) Thanks a lot!

Enrico.


> 
> Regards, Upayavira

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to