Multi-part POST with file and string in HTTPClient 4.1
I need to create Multi-part POST request containing fields: update[image_title] = String update[image] = image-data itself . As you can see both are in associative array called "update". How could I do it with HTTPClient 4.1, because I found only examples for 3.x line of this library. Thank you in advance. Probably too late but might help someone. I had the exact same issue. Assuming that you have a file object which has necessary information about the image HttpPost post = new HttpPost(YOUR_URL); MultipartEntity entity = new MultipartEntity(); ByteArrayBody body = new ByteArrayBody(file