如何通过telnet发送POST请求 [英] How to send a POST request through telnet

查看:309
本文介绍了如何通过telnet发送POST请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何向服务器发送POST请求(例如Google搜索)。我已经知道如何发送GET请求了,

I want to know how to send a POST request to a server (e.g. Google Search). I already know how to send a GET request,

例如:

GET http://www.google.com/

我试过这样做:

POST /wikipedia

POST wikipedia

POST
/wikipedia

POST Search: wikipedia

任何人都知道如何通过telnet / cmd / batch发送POST请求?

Anyone know how to send a POST request through telnet/cmd/batch?

推荐答案

当然可以,不要听npocmaka! Telnet只是打开与服务器端口的TCP连接,不执行任何其他操作。因此,如果您发送正确的命令(在本例中为HTTP请求命令),服务器将响应OK。

Of course you can, don't listen to npocmaka! Telnet just opens a TCP connection to a port in a server and does nothing else. So, if you send the right commands (in this case HTTP request commands) the server will respond OK.

您必须编写的示例如下:

An example of what you have to write is:

POST /path/script.cgi HTTP/1.0
From: frog@jmarshall.com
User-Agent: HTTPTool/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 32

home=Cosby&favorite+flavor=flies
<PRESS ENTER KEY>

我认为您必须以命令的新行结束才能发送。

I think that you have to end with a new line for the command to get send.

这篇关于如何通过telnet发送POST请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆