使用 HTTP Apache 客户端将 XML 响应作为字符串读取时,我收到以下异常:
org.apache.http.MalformedChunkCodingException: CRLF expected at end of chunk
这是在我的代码中读取从 REST API 检索到的 XML:
{WebTarget target = this.client.target(new URI(loginUrl));
Response response = target.request(MediaType.APPLICATION_XML).post(Entity.entity(xmlString, MediaType.APPLICATION_XML));
logger.info("Response -> "+response);
String responseXML = response.readEntity(String.class);}
该响应由服务器以随机间隔触发。
HTTP Request
POST http://{serverName}:{port}/auth/2.8/signin
HTTP Response
An Apache HTTP Response Pojo Object
扬帆大鱼
相关分类