如何使用 Telnet 生成 HTTP POST 请求?
How to generate an HTTP POST request using 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"}
但我收到“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.
任何人都可以帮助我使用 Telnet 设置正确的带参数的 HTTP post 请求吗?
只需在 HTTP 请求 header 和 HTTP 请求 body.The 之间添加另一个空行,参数应该类似于:key1=value1&key2=value2
有谁知道如何将 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.
任何人都可以帮助我使用 Telnet 设置正确的带参数的 HTTP post 请求吗?
只需在 HTTP 请求 header 和 HTTP 请求 body.The 之间添加另一个空行,参数应该类似于:key1=value1&key2=value2