我正在使用cxf JaxWsProxyFactoryBean客户端。我想从客户端禁用多部分流。为了达到目标,我应该调整哪些属性。
我尝试将chunked
设置为false
但不确定如何检查流媒体是否已禁用。
这是我的代码:
Map<String,List<String>> head = getTransmissionHeaders();
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
...........
org.apache.cxf.endpoint.Client yclient = (org.apache.cxf.endpoint.Client) factory.create();
..................
Map<String,Object> ycontext = yclient.getRequestContext();
ycontext.put(MessageContext.HTTP_REQUEST_HEADERS,head);
...............
private Map<String,List<String>> getTransmissionHeaders() {
Map<String,List<String>> head = new HashMap<>();
head.put(HttpHeaderHelper.accEPT_ENCODING,Arrays.asList("gzip","deflate"));
head.put(HttpHeaderHelper.CHUNKED,Arrays.asList("false"));
return head;
}