kylebebak / Requester

Powerful, modern HTTP/REST client built on top of the Requests library
https://kylebebak.github.io/Requester/
MIT License
307 stars 10 forks source link

Ability to view different responses to the same request based on request name #11

Closed amittendulkar closed 6 years ago

amittendulkar commented 6 years ago

I need to send series of POST requests to the same URL. The difference between the requests is KEY, VALUE pairs sent as part of POST body to carry out different operations.

E.g.

post(my_url, data={'payload': '<command name="Command1">...</command>'})
post(my_url, data={'payload': '<command name="Command2">...</command>'})
...

If I run the requests through Requester, the response of the next request overwrites the response of the last one as all requests share the same URL.

Even if I pin the response tab, it won't get the new response from a specific request in it.

Is there a way for me to get response tabs based on the name of the request, like below?

post(my_url, name='Command1', data={'payload': '<command name="Command1">...</command>'})
post(my_url, name='Command2', data={'payload': '<command name="Command2">...</command>'})
kylebebak commented 6 years ago

Nice idea, I think I'll make this configurable via settings.

kylebebak commented 6 years ago

I added a new keyword argument that can be passed to a request, called tabname.

You can use the tabname argument to specify a custom response tab name for your request. The response in this tab can only be overwritten by a request with the same value for the tabname argument.

This takes care of this issue.

amittendulkar commented 6 years ago

Thanks for implementing the request.