You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
If you want to reuse the cookies from a previous request (or across multiple ones), you need to extract the cookies manually from the "set-cookie" from the first request (and from any request that might add a new cookie), and send it along with every subsequent request.
Describe the solution you'd like
It would be nice to be able to do something like:
cookieJar should also have some utility methods to getCookie/setCookie.
Maybe it also could be done automatically with a new setting pactum.request.setUseCookieJar(true); that will make all requests made in the same test to use the same cookie jar. Not sure if it's even possible, but it would be nice :) You could override it for a specific request sending a new cookie jar, for instance.
Thanks! I hope it's not too much asking 🙏
The text was updated successfully, but these errors were encountered:
For user-facing APIs it's typical to keep authentication tokens hidden inside the application and issue an "opaque" cookie to represent the session to the user agent upon successful sign-in. In this case it's really nice to have a built-in way to store the cookie(s) and automatically send the right ones on subsequent requests, as a cookie-supporting HTTP user agent would do.
Would be willing to work on a PR for this if you can provide a bit of guidance on how to integrate.
Hi @tnypxl or @chrisrichard
did you implemented this request or not?
I need Cookies Jar specially when I use withFollowRedirects, because next call should use cookies from previously call.
Thanks
Is your feature request related to a problem? Please describe.
If you want to reuse the cookies from a previous request (or across multiple ones), you need to extract the cookies manually from the "set-cookie" from the first request (and from any request that might add a new cookie), and send it along with every subsequent request.
Describe the solution you'd like
It would be nice to be able to do something like:
cookieJar
should also have some utility methods togetCookie/setCookie
.Maybe it also could be done automatically with a new setting
pactum.request.setUseCookieJar(true);
that will make all requests made in the same test to use the same cookie jar. Not sure if it's even possible, but it would be nice :) You could override it for a specific request sending a new cookie jar, for instance.Thanks! I hope it's not too much asking 🙏
The text was updated successfully, but these errors were encountered: