当前位置: 首页 > news >正文

时间轴网站代码网址最新连接查询

时间轴网站代码,网址最新连接查询,网页版qq注册,重庆哪个区最繁华业务需要调个三方接口 使用GET请求方式 但是!请求参数不在Query中,竟然在Body中,使用Json格式传参 在API调试工具里面可以调通 在java代码里,死活调不通 网上搜了搜,找到一个靠谱的,记录一下 import o…

业务需要调个三方接口

使用GET请求方式

但是!请求参数不在Query中,竟然在Body中,使用Json格式传参

在API调试工具里面可以调通

在java代码里,死活调不通

网上搜了搜,找到一个靠谱的,记录一下

import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
import java.net.URI;public class HttpGetWithEntity extends HttpEntityEnclosingRequestBase {private final static String METHOD_NAME = "GET";@Overridepublic String getMethod() {return METHOD_NAME;}public HttpGetWithEntity() {super();}public HttpGetWithEntity(final URI uri) {super();setURI(uri);}public HttpGetWithEntity(final String uri) {super();setURI(URI.create(uri));}
}
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.web.controller.tool.HttpGetWithEntity;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;public class Test {public void test() throws Exception {JSONObject params = new JSONObject();params.put("systemToken","111");params.put("userId","222");params.put("timeout","333");params.put("fileUrl","444");HttpGetWithEntity httpGetWithEntity = new HttpGetWithEntity("http://*........");httpGetWithEntity.setEntity(new StringEntity(JSONObject.toJSONString(params), ContentType.APPLICATION_JSON));httpGetWithEntity.setHeader("access-token","555");httpGetWithEntity.setHeader("Content-Type","application/json");CloseableHttpResponse response9 = HttpClients.createDefault().execute(httpGetWithEntity);HttpEntity entity = response9.getEntity();String result = "";if (entity != null) {result = EntityUtils.toString(entity, "UTF-8");}response9.close();System.out.println(result);}
}

http://www.15wanjia.com/news/11995.html

相关文章:

  • 怎么建设网站赚钱小程序拉新推广平台
  • 专门做选择题的网站seo关键词排名工具
  • 淘宝内部优惠券网站怎么建设站内营销推广方案
  • 网络搭建安全分析成都自然排名优化
  • 找广告商的平台长沙的seo网络公司
  • mac做网站设计链接提交
  • 动态网站建设步骤seo营销是什么意思
  • 搭建微信网站怎么做中文搜索引擎
  • 上海做网站找谁友链交换网站
  • 网站内链怎么删除百度推广和百度竞价有什么区别
  • 高密做网站哪家强价位steam交易链接可以随便给别人吗
  • 如何做网站 写代码网站制作哪家公司好
  • 池州做网站万能搜索引擎
  • 营销型网站建设一般包含哪些内容做一个网站要多少钱
  • 广东微信网站制作公司神马快速排名优化工具
  • 做购物商城网站设计seo关键词排名优化软件
  • 网站建设项目明细表手机一键优化
  • 日本人真人做真爱的免费网站龙华网站建设
  • java制作网站怎么知道网站有没有被收录
  • javaee就是做网站的吗广告投放网站
  • h5用什么网站来做黄页引流推广
  • wordpress设计页面教程关键词优化包含
  • 象刀设计网站近期国内外重大新闻10条
  • 北京建站推广国内最新新闻
  • 科汛kesioncms网站系统seo怎么读
  • frontpage做的社交网站手机免费建站系统
  • 做动态图片下载哪个网站好深圳推广公司哪家最好
  • 免费做网站txt外链app网络推广公司
  • 建设审批网站查询厦门网站设计公司
  • 广州做网站lomuwwin10系统优化工具