microsoft / typed-rest-client

Node Rest and Http Clients with typings for use with TypeScript
Other
675 stars 118 forks source link

How to reuse cookie in HttpClient #279

Closed Edward-Zhou closed 3 years ago

Edward-Zhou commented 3 years ago

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[bot] commented 3 years ago

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