Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
my $ua = BrowserUA->new(
agent => "Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1",
);
my $req = POST $url,
"Content-Type" => 'multipart/form-data',
"Content" => ,
];
Well,
this component comes from my request in the past because I needed it also for my project, take a look at this component tFileHttpPost at https://exchange.talend.com/#marketplacesearch:gallery=marketplace%252F1&ob=releaseDate&o=0&c=20&d=t...
I do not use custom headers in my scenario except one which indicates that I post text or XML (text/xml) content as you can see at attached picture. Try to change your configuration in a way showed on picture, use "Post parameters from file", this is the attribute which point to file which schould be posted over http.
Ladislav
URL dest = "http://www.mysite.com ";
URLConnection urlCon = dest.openConnection();
// prepare input and output
urlCon.setDoInput(true);
urlCon.setDoOutput(true);
// Disable caching
urlCon.setUseCaches(false);
// Post output
DataOutputStream out =
new DataOutputStream(urlCon.getOutputStream());
out.writeBytes( file.toString );
out.flush();
out.close();
// return servlet response as a DataInputStream
DataInputStream in = new DataInputStream(urlCon.getInputStream());
// and so on
....