-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
APIRequestContextFetch does not seem to populate cookie and update cookie from response #419
Comments
pls try this: page.Context().AddCookies([]playwright.OptionalCookie{
{
Name: "foo",
Value: "bar",
URL: playwright.String(server.PREFIX),
}
page.Request().Fetch... |
Hi Canstand, Thank you for the response. The thing is that the cookie is atually correct in page.Context().Cookies(). There is no need to add optional cookie. The porblem is that when I make the call, for example, page.Request().Get(URL) it does not send the get request with cookie :( I have also looked into the code of get() and fetch() function. It does not seem to populate the cookie from context anywhere. |
According to the playwright official site
"Fetch Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and update context cookies from the response. The method will automatically follow redirects. JSON objects can be passed directly to the request. "
However when I call
page.Request().Fetch(URL, opts)
it does not seem to populate the the coookie from the browser context. I tried to manually encode the cookie into the header and was able to get the response from the API endpoint. The problem remains is that the cookie from the browser context does not automatically updated from the response. Did I miss something or I made the Fetch call in a wrong way?
The text was updated successfully, but these errors were encountered: