我们使用java代码进行接口远程调用第三方接口时,总会抒写接口代码,那么有这么多种方式进行发送请求。那我们应该怎么使用呢? 比如有webservice接口,比如有Post请求的接口,必须有Get请求的接口。比如传的参数有xml的形式,比如传的参数有json格式等等格式情况,那我们的接口请求代码应该如何区别,抒写呢? 我们要根据postMan中的方式来,只要是能够通过postMan发送成功的请求都可以使用 首先是我们的请求方式: 第一点:在postMan的请求方式有:GET、POST、PUT、DELETE请求。 第二点:在PostMan中我们需要传入url链接,那么new HttpGet(url)这里面的url就是链接地址。 GET:HttpGet httpGet = new HttpGet(url); POST:HttpPost method = new HttpPost(url); PUT:HttpPut put = new HttpPut(url); DELETE:HttpDelete delete = new HttpDelete(url);...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with String
Contact String, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack