V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
chaosjohn
V2EX  ›  编程

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

  •  
  •   chaosjohn · 2018-08-20 21:43:00 +08:00 · 3074 次点击
    这是一个创建于 2282 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1876 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 16:31 · PVG 00:31 · LAX 08:31 · JFK 11:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.