java - 获取列表来自输入流
问题描述
我想做的是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();
解决方案
推荐阅读
- docker - 如何在 AWS ECS 上的 Dockerfile 中设置健康检查
- vega-lite - 在灰色背景的 vega-lite 中绘制小倍数
- raku - 作为对象的 Cro 模板
- node.js - 一个请求有多少个数据库操作是正常的?
- c# - 奇怪的错误:Microsoft (R) Visual C# 编译器版本 3.5.0-dev-20359-01 (8da8ba0c)
- java - 无法修复错误:0909006C:PEM 例程:get_name:tomcat 服务器没有起始行
- ios - 文档 x 的文件已被另一个应用程序修改。Xcode 中也有未保存的更改
- android - 在 jetpack compose 中替换 GlobalScope.launch
- android - 如何更改 timepicker android 中的分隔线样式以获得更多 IOS 样式?
- algorithm - 运行 Dijkstra 算法