本文转自:https://blog.csdn.net/ZhiXiongWu/article/details/122928317
PostMan的传参参数为application/x-www-form-urlencoded,java后台代码实现发起请求。
废话不多说,上才艺!!!
一、postMan

这个是postMan上的参数,Post请求
二、java后台代码实现
我这里用的是idea,相信很多小伙伴都是使用idea的!!!

这里需要用的jar包如下:
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.3.1</version>
</dependency>
最后,此文章只是为了记录!内容不多,能解决问题就好!!!
评论