HTTP POST请求为什么要把部分的参数放在url中?
1、问题
在对接短信网关中,发现使用curl工具发送post请求时一直失败,并返回一个页面,检查参数也没有问题,但是就是一直失败。后面仔细看了返回页面,在页面中看到了post请求的Demo,对比了我使用curl发送post请求时http数据发现:Demo中将post的一个参数放在了http协议中request_line的url部分里。对比如下:
我的请求:
POST /send HTTP/1.1\r\n
HOST: smsapi.com\r\n
Accept: */* Content-Length: 44\r\n
\r\n
month=Send&mobile=15980698888&content=msg121
Demo的请求:
POST /send?month=Send HTTP/1.1\r\n
HOST: smsapi.com\r\n
Accept: */* Content-Length: 33\r\n
\r\n
mobile=15980698888&content=msg123
近期评论