首页 > 解决方案 > 获取列表来自输入流

问题描述

我想做的是List<byte[]>InputStream. 我正在向返回的 API 发送 HTTP 请求,List<byte[]>并且我想从内容正文中获取该列表。

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();

标签: javaarrayslistinputstreamapache-httpclient-4.x

解决方案


推荐阅读