I would like to POST (in Java) a multipart/mixed request, where one part is of type ‘application/json’ and the other of type ‘application/pdf’. Does anyone know of a library which will allow me to do this easily? Surprisingly I haven’t been able to find one.
I’ll generate the JSON, but I need to be able to set the content type of that part to ‘application/json’.
Many thanks,
Daniel
Easy, use the Apache Http-client library (this code used version 4.1 and the jars httpclient, httpcore and httpmime), here’s a sample: