4 ms·
I use a simple bash script: #!/bin/bash -x TOK="my-jwt-tok" case "$1" in get-foo) curl -H "header: bearer $TOK" "http://www.e
by eYrKEC2 1y ago
I use a simple bash script:
#!/bin/bash -x
TOK="my-jwt-tok"
case "$1" in
get-foo)
curl -H "header: bearer $TOK" "http://www.example.com/foo" | jq .
;;
post-bar)
curl \
-H "header: bearer $TOK" "http://www.example.com/bar" \
-H "content-type: application/json" \
--data-raw '{"baz":"bap"}'
;;
*)
;;
esac
used like:
./example.bash get-foo
I know it doesn't have the functionality of postman, but this is how I build up interactions with a new API.
- liqilin1567 1y agoI would like to put the request body into a file and use it with `@file.json`.