4 ms·
Well, i use it daily, because it has: - much more sane command line syntax - automatic formatting and highlighting of json/xml/html - automatically show rece
by ralfn 9y ago
Well, i use it daily, because it has:
- much more sane command line syntax
- automatic formatting and highlighting of json/xml/html
- automatically show received headers
- reverts to unproccessed output when redirected
PROTIP: use 'cat' to type the body manually:
cat | http post https://someapi.com/somenendpoint Authorization:sometoken
You can then start typing the message body.
When done, press ctrl+d (EOF) and the request will send and the reply will be printed.
And if you already have the body in a separate file, just pipe it through:
cat mybody.json | http post https://someapi.com/somenendpoint Authorization:sometoken
- derimagia 9y agoDon't need cat for the last one, can you redirected input http post https://someapi.com/somenendpoint Authorization:sometoken < mybody.json
- BenjiWiebe 9y agoAnd if you are like me, you use cat because it can go first in the command line... Until I discovered that file redirects can too! <mybody.json http post https://someapi.com/somenendpoint https://someapi.com/somenendpoint Authorization:sometoken