blog's People
blog's Issues
telnet模拟http请求
1、打开"运行"->cmd进入命令环境;
2、输入"telnet www.baidu.com 80",回车后 ,屏幕为全黑,此时我们利用快捷键"Ctrl+](右中括号)"来打开本地回显功能,这样我们就可以看见我们所打的东西了,如图:(注本阶段执行过程和以下的过程均要求操作时间尽可能短,因为时间一长,便会被认为断开连接。)
3、单击回车,进行编辑状态。
4、输入:"GET / HTTP/1.1"后回车,在第二段接着输入:"HOST:"然后按回车,这样一个简单的HTTP请求就完成了,接着我人只要再按下回车,便向服务器递交这个请求了。如图:(我们来看一下这个是什么意思:GET表示请求方式,/表示请求的根目录下的文件,HTTP/1.1表示HTTP协议版本,HOST就是一个消息头,据某些朋友说1.1的版本一定要加一个"HOST:"可是我实验后发现"HOST :"不加仍旧可以正常发送请求,但是GET HTTP这个必须大写,否则就该请求无法发送)
5、接收服务器返回,这步其实不需要我们来做,因为当我们发送请求后,只需几秒钟,我们便会收到来自服务器反应.
6、这样,请求就算完成了。下面我们在百度中搜一下"1",浏览器中的地址应该是:http://www.baidu.com/s?wd=1.看看请求是怎么样的
怎么样,大家会了吗?以上只是用GET方式进行请求,当然还可以用POST方式进行请求,只是POST我这不方便做实验,所以就不写了。大概的格式给大家参考下:
POST /localhost/login.aspx HTTP/1.1
HOST:
Content-Type:application/x-www-form-urlencoded
Content-Length:10
uid=xxxxxx
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.