JSONObject datatokenJson = new JSONObject();//data域
datatokenJson.put("gridFsId", "607f90ab0e72467a7bd1328b");
String jsonStr = JSONObject.toJSONString(datatokenJson);
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost post = new HttpPost("http://192.168.28.130:8080/supportingPlatformTygn/unstructured/download/gridFsId");
StringEntity postEntity = new StringEntity(jsonStr, "UTF-8");
post.setEntity(postEntity);
//设置消息头
post.setHeader(new BasicHeader("Content-Type", "application/json"));
post.setHeader(new BasicHeader("Accept", "application/json"));
post.setHeader(new BasicHeader("apptoken", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI1ODQ0NTIxYy0xZjA5LTRkODctODA0Mi0zMWI2ODc5YzQyY2MiLCJpYXQiOjE2MTc3ODM0MjgsImlzcyI6InVzZXIiLCJ1c2VySWQiOiI0MDI4ODMzMTc1NGEyYTc1MDE3NTRhYTZhYzY1MDAyNCJ9.RMZ59r9XFeUpRGQ48_bZlivnHFyOfj20zEG2KcDBOy0"));
HttpResponse res
java后台调用下载文件接口获取文件名文件流并且下载文件
最新推荐文章于 2025-05-19 15:26:42 发布