POST MIME Content using LWP




I got a MIME data that is divided into 3 parts depending on the content
separated by boundary. The MIME content looks like this:

Content-type: multipart/form-data; boundary=LINE
Content-length: 120

Content-Disposition: form-data; name="authenticate"
<----- XML Content having authentication information ----->

Content-Disposition: form-data; name="service"
<----- XML Content having service requested ------->

Content-Disposition: form-data; name="data"
<---- Text data required for the request to be serviced ----->


I have a request is to post the above MIME to a server using HTTP. My
question is
Is it possible to use LWP for this purpose as

use LWP;
my browser = LWP::UserAgent->new();
$resp = $browser->post(url, \@form_data,
Header1 => Value1, Header2 => Value2,. );

Normally post method accepts form data in parameter/value pair, so in
my case if I want to post the entire MIME content as above instead of
parameter /value pair, how can I do it?

Any help would be highly appreciated.



Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question