HttpClient发送Put请求

http://127.0.0.1:8080/x x x/xx?id=xx&value=xxx

 

类似这样的接口请求为PUT。如何进行发送请求获取返回值

            //设置uri
          String url = "https://pacaio.match.qq.com/irs/rcd?cid=146&token=49cbb2154853ef1a74ff4e53723372ce&ext=ent&page="+page+"&callback=__jp11";

          //获取HttpClient对象
          CloseableHttpClient client = HttpClients.createDefault();

          //获取get对象
          HttpGet get = new HttpGet(url);


          //设置请求头内容
          // get.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36");

          //发送请求
          CloseableHttpResponse response = client.execute(get);

          //判断请求结果
          if (response.getStatusLine().getStatusCode() == 200) {
              //获取响应体
              HttpEntity entity = response.getEntity();

              //读取响应体内容
              String string = EntityUtils.toString(entity, "gb2312");
            //解析响应体
                
          }
            URL url1 = new URL(buffer.toString());
            URLConnection connection = url1.openConnection();
            InputStream inputStream = connection.getInputStream();
            String result = IOUtils.toString(inputStream);
            JSONObject jsonObject = JSONObject.parseObject(result);
              //解析Json

 

引入 hutool jar