jiaoyiping
@Test
    public void testAdd() throws IOException {
        HttpPost post = new HttpPost("http://localhost:8182/api/media/add?app=test&access_token=1234&fileName=测试一下.jpg&ContentType=image/jpeg");
        HttpEntity entity = new FileEntity(new File("C:\\Users\\Administrator\\Desktop\\C360_2013-06-24-08-44-38-027.jpg"));
        post.setEntity(entity);
        CloseableHttpClient httpClient = HttpClients.createDefault();
        CloseableHttpResponse response = httpClient.execute(post);
        System.out.println(response.getStatusLine().getStatusCode());
        response.close();
        httpClient.close();
    }

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-07-28
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2021-12-02
  • 2021-07-21
  • 2022-12-23
相关资源
相似解决方案