从InputStream获取List <byte []>

时间:2019-09-28 15:51:20

标签: java arrays list inputstream apache-httpclient-4.x

我想做的是从List<byte[]>获得InputStream。我正在将HTTP请求发送到返回List<byte[]>的API,我想从内容主体中获取该列表。

HttpPost httpPost = new HttpPost(endPoint);
CloseableHttpClient httpclient = HttpClients.createDefault();
httpPost.setEntity(new ByteArrayEntity(ReqBody));
CloseableHttpResponse response = httpclient.execute(httpPost);
System.out.println(response.getStatusLine());
System.out.println(response.getEntity().getContentType());

return response.getEntity().getContent();

0 个答案:

没有答案