cli icon indicating copy to clipboard operation
cli copied to clipboard

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

Open kamalhm opened this issue 3 years ago • 14 comments

Checklist

  • [x] I've searched for similar feature requests.

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

kamalhm avatar Dec 08 '22 13:12 kamalhm

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

jkbrzt avatar Dec 08 '22 15:12 jkbrzt

Has there been any progress on this?

Megapixel99 avatar Dec 18 '23 20:12 Megapixel99

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

keisto avatar Dec 22 '23 00:12 keisto

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...

Basti-Fantasti avatar Jun 21 '24 07:06 Basti-Fantasti

We also love to hear about the pre/post-request script

ByMuath avatar Jul 30 '24 18:07 ByMuath