【发布时间】:2021-04-01 21:58:18
【问题描述】:
我正在使用 org.apache.http.client.HttpClient 并且我正在尝试访问请求 HTTPEntity 的有效负载而不消耗底层流。 我尝试使用
EntityUtils.toString(someEntity);
但这会消耗流。 我只想保留在 HTTP 请求中发送到 String 对象的有效负载,例如
示例代码:
String uri = "someURI";
HttpPut updateRequest = new HttpPut(uri);
updateRequest.setEntity(myHttpEntity);
任何提示表示赞赏。
【问题讨论】:
标签: java apache-httpcomponents httpentity