Questions tagged [httpie]

HTTPie is a command line HTTP client. Its goal is to make CLI interaction with web services as human-friendly as possible. It provides a simple http command that allows for sending arbitrary HTTP requests using a simple and natural syntax, and displays colorized responses. HTTPie can be used for testing, debugging, and generally interacting with HTTP servers.

HTTPie: a CLI, cURL-like tool for humans

HTTPie is a command line HTTP client. Its goal is to make CLI interaction with web services as human-friendly as possible. It provides a simple http command that allows for sending arbitrary HTTP requests using a simple and natural syntax, and displays colorized responses. HTTPie can be used for testing, debugging, and generally interacting with HTTP servers.

https://httpie.org/

103 questions
94
votes
4 answers

Sending nested JSON object using HTTPie

I am trying to use HTTPie to parse to send some nested JSON object, but I can not find how. It is pretty clear how to send a JSON object but not a nested one such as { "user": { "name": "john" "age": 10 } }
MaatDeamon
  • 9,532
  • 9
  • 60
  • 127
35
votes
1 answer

How to print the request when using HTTPie?

Is it possible to print on output the request (headers and body), in addition to the response, using HTTPie?
mike
  • 1,734
  • 1
  • 23
  • 32
20
votes
2 answers

How to send a POST request using HTTPie?

I have a basic silex application, and I try to test it using HTTPie. Yet when posting using: http POST http://localhost:1337 data="hello world" The data, that I get from the Request object via: $data = $request->request->get('data'); will always…
k0pernikus
  • 60,309
  • 67
  • 216
  • 347
20
votes
3 answers

How to make a post with a from data of empty json through HTTPie?

I'm wondering how to make a POST request with a from data of empty json through HTTPie? The corresponding Curl solution is here: curl -X POST -H "Content-Type: application/json" -d '{}' http://ooxx.asdf/
Drake Guan
  • 14,514
  • 15
  • 67
  • 94
15
votes
2 answers

Token Authentication Django Rest Framework HTTPie

Hello I am trying to test Token Authentication i have implemented with DRF using httpie as per the tutorial in this following link The following command: http GET 127.0.0.1:8000/api/projects/ 'Authorization: Token…
Paul Nyondo
  • 2,126
  • 2
  • 23
  • 30
9
votes
1 answer

How to upload a file with PUT in HTTPie

I'm searching for the syntax to write a PUT operation that upload a file with HTTPie. Please could you point me to the right syntax ? I could not find a way to do so on the official documentation
MaatDeamon
  • 9,532
  • 9
  • 60
  • 127
7
votes
1 answer

How to use httpie and jq within docker?

How to use httpid and jq within docker? I want to get the ip only in json result like '34.10.12.40' docker run -it --rm blacktop/httpie -b ifconfig.co/json { "country": "United States", "country_eu": false, "country_iso": "US", …
Leo Chu
  • 83
  • 1
  • 1
  • 6
6
votes
1 answer

How to capture actual response code and response body with HTTPie in bash script?

I have a bash script to call several APIs using HTTPie. I want to capture both the response body AND the HTTP status code. Here is the best I have managed so far: rspBody=$( http $URL --check-status --ignore-stdin ) statusCode=$? Command…
Bobby Cottle
  • 85
  • 3
  • 9
6
votes
3 answers

Content-Type for one file in multipart/form-data with HTTPie

I use HTTPie to POST a multipart/form-data request (passing the -f option). It includes a file field (using a @ option). The corresponding part of the multipart request has a pseudo-header Content-Disposition, but does not have a pseudo-header…
Florent Georges
  • 2,190
  • 1
  • 15
  • 24
6
votes
3 answers

How to print response headers to console and save content to file?

How can I print the response headers to console and save the response content to a file? I tried http GET http://download.sysinternals.com/files/SysinternalsSuite.zip --output sis.zip But this printed both the headers and content to the file,…
Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
5
votes
1 answer

Httpie hangs in Git Bash terminal on Windows 10

According to the official documentation httpie tool also works on Windows 10, however when I run the command in terminal it simply hangs and nothing happens: $ http :8000/ Is there an explanation what is going on and preferably a workaround?
Evgeny Bobkin
  • 4,092
  • 2
  • 17
  • 21
4
votes
1 answer

HTTPie not recognizing second parameter of GET request

When I type in http GET localhost/api/data?param1=3¶m2=7 I get a response that indicates the second parameter doesn't exist. I'm attempting to test my REST api and cannot figure out why the second parameter isn't recognized when using HTTPie.…
David Kamer
  • 2,677
  • 2
  • 19
  • 29
4
votes
2 answers

Sending raw body with httpie in http-prompt

HTTPie fills the request's body with stdin, so it's easy to send raw text or JSON with echo '{...}' | http POST example.com like here: Sending nested JSON object using HTTPie. http-prompt is a handy CLI interface for http and it allows setting body…
Anton Tarasenko
  • 8,099
  • 11
  • 66
  • 91
4
votes
3 answers

How to use a CA (like curl's --cacert) with HTTPie

In curl I can connect with a private key, client cert, and a ca cert like this curl --cert cert.pem --key key.pem --cacert ca.pem https://example.org I can see the --cert and --cert-key options in HTTPie, but how could I use the --cacert option in…
Ahmadster
  • 181
  • 1
  • 6
4
votes
1 answer

how to run httpie from script.py

I need to send forms to a rest service from py-scripts. i try to do it using httpie. when i invoke run(['http', '--help']) i've got expected result. if i invoke run(['http', 'http://site/page']) the script is stuck and nothig happens. I also tried…
feech
  • 404
  • 4
  • 15
1
2 3 4 5 6 7