问题
I use AsyncHttpClient with Netty provider to get response body. It works ok with most responses, the problem is with multipart ContentType. For example, this response:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: multipart/related; type="application/xop+xml"; boundary="uuid:2dfd79bd-bdd5-4e15-bf4a-d08b63918c37"; start="<root.message@cxf.apache.org>"; start-info="text/xml";charset=UTF-8
Transfer-Encoding: chunked
Date: Fri, 20 Mar 2015 13:09:50 GMT
--uuid:2dfd79bd-bdd5-4e15-bf4a-d08b63918c37
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml";
Content-Transfer-Encoding: binary
Content-ID: <root.message@cxf.apache.org>
<soap:Envelope></soap:Envelope>
My client uses getResponseBody
method. The return value is:
--uuid:2dfd79bd-bdd5-4e15-bf4a-d08b63918c37
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml";
Content-Transfer-Encoding: binary
Content-ID: <root.message@cxf.apache.org>
<soap:Envelope></soap:Envelope>
NettyResponse completely ignores the Content-Type: multipart/related
header and wipes out the headers. Returned body still contains headers for individual parts of the response, without the information about the ContentType and boundary (it has already been stripped out).
Is it true that Netty lacks the support for multipart responses? Or am I missing something?
EDIT: There is a HTTP multipart support codec, but seems to be only for multipart requests, not responses.
来源:https://stackoverflow.com/questions/29171082/nettyresponse-ignores-multipart-content-type