发送具有指定请求正文和标头的HTTP帖子并获得响应

时间:2018-10-07 06:43:34

标签: java http post request

我的问题是我如何将http帖子发送到带有请求正文和标头的服务器上,并获取响应代码,并同时获取String 格式的响应内容

发布网址

http://192.168.1.2/default/en_US/sms_info.html?type=sms

请求正文

action:sms
send:send
line1:1
line2:1
line3:1
smscontent:im sending you this message from website
telnum:03459347900

标题

Origin:http://192.168.8.1
Upgrade-Insecure-Requests:1
Content-Type:application/x-www-form-urlencoded
Authorization:Basic YWRtaW46YWRtaW4=

1 个答案:

答案 0 :(得分:0)

只需使用Postman或任何其他HTTP客户端。