I want to read a multipart/mixed content-type response returned from xquery in java. I am using http client in java to call/execute the xquery. In java i can able to get only the response body as string or stream or byte content. I want to separate the parts of the multipart response in java using existing multipart APIs.
Asked
Active
Viewed 730 times
-2
-
http://stackoverflow.com/questions/30387603/parsing-multipart-form-data-using-apache-commons-file-upload/30403389#30403389 – ZhongYu Aug 12 '15 at 05:53
-
This really doesn't seem to be related to XQuery. You could be trying to read this multipart response from any Web Server. – adamretter Aug 13 '15 at 10:08
-
This indeed has nothing to do with XQuery. The question should be rephrased as: "How can I consume a multipart response with the Apache HTTP Client, version 4?" Adapt the version accordingly. – Florent Georges Aug 13 '15 at 12:47
1 Answers
0
As far as I know, the Apache HTTP Client does not support such a multipart response. But you can use MIME4J for instance to parse it. The class org.expath.httpclient.impl.MultipartResponseBody does exactly that (look at the function analyzeParts
).

Florent Georges
- 2,190
- 1
- 15
- 24