Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
ip7x12v5
V2EX  ›  Linux

Postman 这个工具可以在 centos 下面使用命令行执行测试吗?

  •  
  •   ip7x12v5 · Jan 3, 2018 · 5889 views
    This topic created in 3241 days ago, the information mentioned may be changed or developed.

    最近在测试数据,使用 POSTMAN 在 win 下面还挺好用的,Centos 下不知道能不能用,因为我的 Centos 是命令行没有图形界面,不知能否使用,或者有没有什么能在命令行下模拟 post 请求的工具。

    12 replies  •  2018-01-03 11:16:13 +08:00
    hujnnn
    hujnnn
    Jan 3, 2018 via iPhone
    1
    postman 可以自动把请求参数转成各种编程语言的 HTTP 请求,包括 shell 命令
    luoqeng
    luoqeng
    Jan 3, 2018
    2
    curl
    XueSeason
    XueSeason
    Jan 3, 2018❤️1
    3
    newman?
    nicevar
    nicevar
    Jan 3, 2018
    4
    直接用 curl
    thecon
    thecon
    Jan 3, 2018
    5
    命令行就用 httpie 呗
    cha1
    cha1
    Jan 3, 2018❤️1
    6
    HTTPie 比 curl 友好。


    几个简单的例子:
    ```
    $ http -v GET example.org
    GET / HTTP/1.1
    Accept: */*
    Accept-Encoding: gzip, deflate
    Connection: keep-alive
    Host: example.org
    User-Agent: HTTPie/0.9.9

    $ http -v --form PUT example.org param1=value1 param2=value2
    PUT / HTTP/1.1
    Accept: */*
    Accept-Encoding: gzip, deflate
    Connection: keep-alive
    Content-Length: 27
    Content-Type: application/x-www-form-urlencoded; charset=utf-8
    Host: example.org
    User-Agent: HTTPie/0.9.9

    param1=value1&param2=value2

    $ http -v PUT example.org param1=value1 param2=value2
    PUT / HTTP/1.1
    Accept: application/json, */*
    Accept-Encoding: gzip, deflate
    Connection: keep-alive
    Content-Length: 40
    Content-Type: application/json
    Host: example.org
    User-Agent: HTTPie/0.9.9

    {
    "param1": "value1",
    "param2": "value2"
    }

    $ http -v PUT example.org User-Agent:Postman param1=value1 param2=value2
    PUT / HTTP/1.1
    Accept: application/json, */*
    Accept-Encoding: gzip, deflate
    Connection: keep-alive
    Content-Length: 40
    Content-Type: application/json
    Host: example.org
    User-Agent: Postman

    {
    "param1": "value1",
    "param2": "value2"
    }
    ```

    HTTPie 的官网:
    https://httpie.org/
    prolic
    prolic
    Jan 3, 2018
    7
    postman 能直接生成 curl,其实感觉用 ipython 发 requests 更方便点
    checgg
    checgg
    Jan 3, 2018
    8
    curl + 1
    我一般请求都会通过 curl。
    postman 很少用。
    curl + jq . 简直不要太爽。
    ip7x12v5
    ip7x12v5
    OP
    Jan 3, 2018
    9
    @checgg 谢谢!学习了!
    ip7x12v5
    ip7x12v5
    OP
    Jan 3, 2018
    10
    @prolic 谢谢!学习了!
    ip7x12v5
    ip7x12v5
    OP
    Jan 3, 2018
    11
    @zqhong 感谢!感谢!
    Tink
    Tink
    Jan 3, 2018 via iPhone
    12
    httpie
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4884 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 51ms · UTC 03:05 · PVG 11:05 · LAX 19:05 · JFK 22:05
    ♥ Do have faith in what you're doing.