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

2018-08-20 21:43:00 +08:00
 chaosjohn

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

3101 次点击
所在节点    编程
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/481598

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX