我正在尝试通过第三方服务获取apache骆驼中的zip文件作为应用程序/八位字节流。我正在使用.to(https4://)我正在使用https4://
来启动该服务。但是,正在获得org.apache.http.connectionclosedexception:内容长度分隔的消息正文的过早结束(预期:已收到>第三方服务会在POSTman中正确给出响应。
我仍然尝试使用生产者模板。
public void process(Exchange exchange) throws Exception {
exchange.getIn().setHeader(Exchange.HTTP_QUERY, httpQuery);
exchange.getIn().setHeaders(exchange.getIn().getHeaders());
exchange.getIn().setHeader(Exchange.HTTP_URI, constant(url));
exchange.getIn().setHeader(Exchange.HTTP_PATH, constant(httpPath));
exchange.getIn().setHeader(Exchange.HTTP_QUERY, constant(httpQuery));
exchange.getIn().setHeader(Exchange.ACCEPT_CONTENT_TYPE,constant("application/octet-stream"));
exchange.getIn().setHeader(Exchange.HTTP_METHOD, constant("GET"));
exchange.getIn().setHeader(Exchange.CONTENT_TYPE, constant(ContentType.APPLICATION_JSON.getMimeType()));
}
});
期待字节流作为响应