Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 46662
Status: rejected
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: andy.shevchenko [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 5.823
Fixed in: (no value)



Subject: Multipart request couldn't be done
Hello. The multipart request (Content-Type: multipart/relative) couldn't be done because of invalid content. So, briefly, I have a code like this: $ua = LWP::UserAgent->new(); $req = HTTP::Request(POST => $url, ...) $req->add_part(HTTP::Message->new(...some XML...)) $req->add_part(HTTP::Message->new(...JPEG...)) $ua->request($req); I have got '400 Bad Request'. After deep investigation I found that the content of the request is invalid and should be updated (I'm using now $req->_content($req); workaround). That behaviour is not described in documentation anyhow. My opinion the cache should be updated after each part is added. Seems the problem still present in the last version of the library. P.S. This is implementation of the Google REST request to add JPEG file with metadata at one request. Andy Shevchenko.
I'm not able to reproduce and AFAICT the cache is invalidated after each add_part() call. Can you provide a little test program that demonstrates the failure. Preferably without involving $ua->request(). This is what I tried: use HTTP::Request; my $req = HTTP::Request->new(POST => "http://www.example.com", [Content_type => "multipart/relative"], ); $req->add_part(HTTP::Message->new([ Content_type => "text/xml", ], "<foo>...</foo>" )); $req->add_part(HTTP::Message->new([ Content_type => "image/jpeg", ], "...image data...", )); print $req->content;
Not reproducible