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

How to reuse cookie in HttpClient #279

Closed
Edward-Zhou opened this issue Jun 22, 2021 · 1 comment
Closed

How to reuse cookie in HttpClient #279

Edward-Zhou opened this issue Jun 22, 2021 · 1 comment

Comments

@Edward-Zhou
Copy link

I am trying to use typed-rest-client/HttpClient like below:

        let rest:httpm.HttpClient = new httpm.HttpClient('zhihu');
        let bb = await rest.post('https://www.zhihu.com/udid',"")    ;
        let res2 = await rest.post('https://www.zhihu.com/api/v3/account/api/login/qrcode',"");
        let body2: string = await res2.readBody();  

But the body2 return 403 error which is caused by the second request did not attach the cookies from the first request.

I am trying to confrim whether there is any configure to reuse the cookies or share the cookies for the same domain.

I searcha and found a similar issue below, but it closed with any answers.

Cross-domain authenticated requests? #206

@github-actions
Copy link

This issue has had no activity in 90 days. Please comment if it is not actually stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants