chaosjohn
V2EX  ›  编程

撸了个请求测试工具 http-echo

  •  
  •   chaosjohn · Aug 20, 2018 · 3866 views
    This topic created in 2865 days ago, the information mentioned may be changed or developed.

    http-echo

    介绍

    用来回显 http/https 请求的具体内容( method/header/query/body 等等),适用于熟悉一门新的编程语言或新的框架,分析判断请求是否发送正确.

    Demo 地址

    https://echo.jeek.club or http://echo.jeek.club

    用法

    直接请求 demo 地址

    举例:

        $ curl "https://echo.jeek.club/this-is-path?query-a=hello&query-b=echo"
        
        $ curl -X POST "https://echo.jeek.club/this-is-path?query-a=hello&query-b=echo" -d 'key-a=1&key-b=bonjour'
        
        $ curl -X POST "https://echo.jeek.club/this-is-path?query-a=hello&query-b=echo" -H "Content-Type: application/json" -d '{"key-a": 1, "key-b": "bonjour"}'
    

    结果:

      {
        "method": "POST",
        "path": "this-is-path",
        "headers": {
            "Accept-Encoding": "gzip",
            "X-Real-Ip": "117.85.25.111",
            "X-Forwarded-Proto": "https",
            "X-Forwarded-For": "117.85.25.111",
            "Content-Type": "application/json",
            "Accept": "*/*",
            "Content-Length": "32",
            "User-Agent": "curl/7.54.0",
            "Host": "echo.jeek.club"
        },
        "accept": "*/*",
        "params": {
            "key-a": 1,
            "key-b": "bonjour",
            "query-a": "hello",
            "query-b": "echo"
        },
        "content-type": "application/json",
        "content-length": "32",
        "body": "{\"key-a\": 1, \"key-b\": \"bonjour\"}",
        "bodyPretty": {
            "key-a": 1,
            "key-b": "bonjour"
        },
        "query": "query-a=hello&query-b=echo",
        "queryPretty": {
            "query-a": "hello",
            "query-b": "echo"
        }
      }
    

    github

    https://github.com/ChaosJohn/http-echo

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   913 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 20:06 · PVG 04:06 · LAX 13:06 · JFK 16:06
    ♥ Do have faith in what you're doing.