httpie / http-prompt

An interactive command-line HTTP and API testing client built on top of HTTPie featuring autocomplete, syntax highlighting, and more. https://twitter.com/httpie
https://http-prompt.com
MIT License
8.96k stars 326 forks source link

Support for setting variables based on response data #207

Open sarumont opened 3 years ago

sarumont commented 3 years ago

It would be nice to be able to set variables for a future request (or cd to a path) based on the previous response data. Something like JSONpath syntax would be simple yet effective:

Response body:

{
  "id": "17f96808-886a-452e-bbc7-956d27c6cd9d",
  ...
}

> fooId=$.id

> cd $.id
nejdetckenobi commented 1 month ago

Oh wow! I never thought this feature would be missing. That'd be a really huge improvement. I don't want to copy the data like JWT token all the time.