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
32.73k stars 3.68k forks source link

Feature request: pre-request script and post-request script #1454

Open kamalhm opened 1 year ago

kamalhm commented 1 year ago

Checklist


Enhancement request

Please add pre and post request script.


Problem it solves

Sometimes when working with secure API that needs to create a request signature using complicated stuff (e.g hashing the host, request url, request body, etc) it's tiresome to manually create it and then add it to request header.

Having access to pre-request script, generate the signature, and use the generated signature to a certain header will be useful.

Post-request script: also on the case of secure API, we may need to get a token and that token now needs to be included on every request on certain header. or maybe we've hit a login endpoint and now want to store the JWT token from the response to a variable


Additional information, screenshots, or code examples

Similar to pre-request script in and test-script (post-request script) in postman

jkbrzt commented 1 year ago

Hey @kamalhm, scripting is definitely on our roadmap. Thanks for the feedback!

Megapixel99 commented 6 months ago

Has there been any progress on this?

keisto commented 6 months ago

🤞 hope it comes out soon... Looking at https://hoppscotch.io in the mean time

Basti-Fantasti commented 2 weeks ago

Is there an update on that topic? It would really simplify the process of working with bearer tokens in requests. It would be great to write a script to take the bearer token from a login request and to automatically write to a defined variable...