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.