如何使用Telnet生成HTTP POST请求?

如何使用Telnet生成HTTP POST请求?,http,post,request,telnet,Http,Post,Request,Telnet,有人知道如何将HTTP正文参数添加到请求中吗?我试过类似于 telnet xxxx.com 80 Trying 128.x.xxx.45... Connected to xxxx.com. Escape character is '^]'. POST /webapps/methods/check-post HTTP/1.1 Host: xxxx.com Content-Type: application/json; charset=utf-8 {"id":"myid","color":"blue

有人知道如何将HTTP正文参数添加到请求中吗?我试过类似于

telnet xxxx.com 80
Trying 128.x.xxx.45...
Connected to xxxx.com.
Escape character is '^]'.
POST /webapps/methods/check-post HTTP/1.1
Host: xxxx.com
Content-Type: application/json; charset=utf-8
{"id":"myid","color":"blue"}
但我得到了“400个错误请求”的回复

HTTP/1.1 400 Bad Request
Date: Thu, 31 Aug 2017 13:54:32 GMT
Server: Apache/2.4.18 (Ubuntu)
Content-Length: 311
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
<hr>
<address>Apache/2.4.18 (Ubuntu) Server at xxxx.com Port 80</address>
</body></html>
Connection closed by foreign host.
HTTP/1.1400错误请求
日期:2017年8月31日星期四13:54:32 GMT
服务器:Apache/2.4.18(Ubuntu)
内容长度:311
连接:关闭
内容类型:text/html;字符集=iso-8859-1
400错误请求
错误的请求
您的浏览器发送了此服务器无法理解的请求。


xxxx.com端口80上的Apache/2.4.18(Ubuntu)服务器 连接被外部主机关闭。

谁能帮我用参数设置一个正确的HTTP post请求,使用Telnet?

只需在HTTP请求标头和HTTP请求正文之间添加另一个空行。参数应类似于:
key1=value1&key2=value2
只需在HTTP请求标头和HTTP请求正文之间添加另一个空行。参数应类似于:
key1=value1&key2=value2的可能重复