Abhishek Dhote
Abhishek Dhote

Reputation: 1648

How do I send an Object and a file in a single HTTP request in java?

I need to send a java object and a file via HTTP in a single HTTP request. I am facing following issue:

I am using org.apache.commons.httpclient.HttpClient implementation for this and the problem is the servlet on the server side expects the multipart request as mentioned in the request and hence the Object which I send as a byte[] stream gets corrupted. If I just either file or object in a single request then this works fine.

Upvotes: 1

Views: 1205

Answers (1)

Related Questions