Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookies Jar for withFollowRedirects #373

Open
ruslK opened this issue Aug 16, 2024 · 1 comment
Open

Cookies Jar for withFollowRedirects #373

ruslK opened this issue Aug 16, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ruslK
Copy link

ruslK commented Aug 16, 2024

Is your feature request related to a problem? Please describe.
In some scenarios for Redirection, next call required to use Cookies from previously call, but we don't see that happing in Pactum

Describe the solution you'd like
Global or call config to enable Cookie Jar, like .enableCookiesJar()

something I see config in postman, where Cookie Jar Enable all the time, we user can disable it:
image

@ruslK
Copy link
Author

ruslK commented Aug 16, 2024

I tried use HTTP Cookie Agent for PHIN Config:

const tough = require("tough-cookie");
const cookiesAgent = require('http-cookie-agent/http');
const jar = new tough.CookieJar();

...
.withCore(new cookiesAgent.MixedCookieAgent({ cookies: { jar } }))
...

but no luck yet

@ASaiAnudeep ASaiAnudeep added the enhancement New feature or request label Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants