Feature request: support for copying/pasting and editing headers #142
Replies: 3 comments
-
I'm working on a pre-request/post-response script feature which might help with this. You can associate a script with a request, and execute some simple Python code. So, you could have a simple one liner attached to your "get oauth token" request which sets a variable for the duration of the session. Something like: def on_response(response, posting):
posting.variables.my_token = response.json.get("token") Other requests can then use $my_token. I do want to add support for copy and pasting headers too though! |
Beta Was this translation helpful? Give feedback.
-
Also think the "update" button is a pretty nice idea too! |
Beta Was this translation helpful? Give feedback.
-
Great! Adding scripts would be very helpful, then you'll only have to change the token in a single place. |
Beta Was this translation helpful? Give feedback.
-
One of the services I'm accessing uses OAuth access tokens in the header of requests. Right now, I have to manually enter that access token for every URL I'm testing. That's a bit of a pain since that token cannot be retrieved a second time and since I cannot copy the value from posting directly. I have to use the fiddly mouse select in my terminal. Collection-wide config is very useful here, but copy/pasting of headers would also be great. What's more, whenever my access token expires I have to delete the header and add it back again with the new token. Would be useful if clicking on the header would populate the name and value inputs and when changing those values would change the header. Since you can have multiple headers with the same name, maybe add an "update" button next to "add header" which is disabled whenever the name is unique and there is nothing to update, and thus providing a choice for the user to update the header or add a new one otherwise.
Love posting, ;-)
Beta Was this translation helpful? Give feedback.
All reactions