httpie / cli

🥧 HTTPie CLI — modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more.
https://httpie.io
BSD 3-Clause "New" or "Revised" License
33.56k stars 3.67k forks source link

Collections in httpie? #537

Open yangwao opened 7 years ago

yangwao commented 7 years ago

I'm regular user of Postman, I have there lot of requests in structured collections, is there any recommended option how to store or create 'book' of requests for each project? Thanks!

jkbrzt commented 7 years ago

Could you describe your workflow with those collections in Postman?

yangwao commented 7 years ago

I'll pick project in my collection, then I'll pick environment where which I want do request for and after that I'll see my saved requests for particular routes w/ prefilled headers and bodies. Then I'll pick particular request and I'll press send and I'll get response. Also, I need share this collections and requests as well.

screen shot 2016-11-12 at 10 37 24
eliangcs commented 7 years ago

@yangwao You might want to take a look at httpie-based http-prompt (author here 😃). It offers env,source and exec commands, which can be used like Postman's collections.

dsego commented 7 years ago

I think what we need here is support for HTTP request files, akin to Sublime Text RESTer plugin. Also Postman can export these via the Code button.

Take any example here https://httpie.org/docs#request-url, it would be useful to write the HTTP request in a file, e.g

sample_request.httpspec

PUT / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Content-Type: application/json
Host: example.org

{
    "name": "John",
    "email": "john@example.org"
}

and than be able to run it with httpie in some way, maybe http -- sample_request.httpspec or http --spec sample_request.httpspec.

For me this would be way more useful than Postman, because it would be faster and easier to use with my favorite text editor and terminal, with less UI in the way.

certifiedloud commented 7 years ago

@dsego, that's exactly what I'm looking for. It would also be nice to have environment variable support. Something like:

PUT / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Content-Type: application/json
Host: example.org
Token: {{ myToken }}

{
    "name": "John",
    "email": "john@example.org"
}

Then have myToken read from an environment variable, or from a specified env file.

sriyanfernando commented 7 years ago

Hi, I'm a new to open source projects. I would like work on this issue. Could you please provide me with more info?