mockit icon indicating copy to clipboard operation
mockit copied to clipboard

Add support for setting cookies in responses

Open modernist opened this issue 5 years ago • 2 comments

It would be great if one could configure endpoints to send cookies in the response.

modernist avatar Apr 23 '19 20:04 modernist

Hey @modernist

Got any ideas on how this would look?

For example:

Would this feature accept key, value pairs from the user on each response? and we could use res.cookie('cookieName', 'value'); something like this to send the values in the responses?

boyney123 avatar Apr 23 '19 21:04 boyney123

I guess an interface similar to the one provided in Postman / Insomnia for setting cookies on requests would be adequate. So, a list of key/value pairs per endpoint would be more than enough as a first step. Later on it would be possible to define cookies that are sent on every endpoint, but whose value can be customized per endpoint, and finally perhaps create some rules that allow the generation of random values (e.g. numbers / strings / dates)

modernist avatar Apr 24 '19 20:04 modernist