zoukankan      html  css  js  c++  java
  • telnet模拟http訪问

    HTTP协议经常使用的无非就那么几个命令

    GET

    HEAD

    PUT

    POST


    此处简单说下http的GET和HEAD

    举两个简单的样例:

    GET的样例

    telnet serverip 80

    GET http://www.aaa.com/aaa.html  //输入get命令和get的url

                                         HTTP/1.0 200 OK
    Date: Thu, 24 Apr 2014 01:19:11 GMT
    X-Powered-By: ASP.NET   yltv
    X-AspNet-Version: 2.0.50727
    Content-Type: text/html; charset=gb2312
    Content-Length: 28309
    X-Cache: HIT from cache121.aaa.com
    Connection: close


    <h1>john_test page!!!</h1>

    失去了跟主机的连接。


    HEAD的样例 查看响应的HTTP头信息在win下可取代CURL 命令的-I參数 

    telnet serverip 80

    GET http://www.aaa.com/aaa.html  //输入get命令和get的url

                                         HTTP/1.0 200 OK
    Date: Thu, 24 Apr 2014 01:19:11 GMT
    X-Powered-By: ASP.NET   yltv
    X-AspNet-Version: 2.0.50727
    Content-Type: text/html; charset=gb2312
    Content-Length: 28309
    X-Cache: HIT from cache121.aaa.com
    Connection: close


    失去了跟主机的连接。


    就像squid有个清缓存的http指令。PUGRE

    假设项清除某个页面的缓存就能够telnet到此squidserver的80port

    然后运行PUGRE http://host/url 这样就能够pugre缓存了

    但前提是squid的acl同意!


    原来HTTP协议就是如此的简单!!!

    ##########################################

    迷途小运维随笔

    作者:john

    转载请注明出处

  • 相关阅读:
    Spring Security 记住我功能 详解
    浅谈前端SPA(单页面应用)
    Token问什么可以避免CSRF/XSRF?
    总结 XSS 与 CSRF 两种跨站攻击
    localStorage,sessionStorage和cookie的区别及使用
    cookie,token验证的区别
    彻底弄懂session,cookie,token
    HTTP cookies 详解
    纯css3实现文字间歇滚动效果
    我的less学习之路
  • 原文地址:https://www.cnblogs.com/bhlsheji/p/5067745.html
Copyright © 2011-2022 走看看