Reqwest: Manually populate cookie store

Created on 10 Apr 2020  路  2Comments  路  Source: seanmonstar/reqwest

Went through the documentation and I couldn't find a way to manually insert cookies into the cookie storage.

My use case is that once I login into the website, the same response cookies would work for some other domains, so I want to create new cookies, with different domains values into my reqwest client instance doing the requests.

It seems that the solution right now would be to store them alongside the client and embed them at each request, but that seems too cumbersome. Is there something that I am not seeing it? Thanks.

Most helpful comment

I'm facing the same use case where I have cookie before the client is created. I want to be able to define cookie and push them to the inner store to be used as cookie for the query.

All 2 comments

I think you can use ClientBuilder::default_headers() for this.

I'm facing the same use case where I have cookie before the client is created. I want to be able to define cookie and push them to the inner store to be used as cookie for the query.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dbrgn picture dbrgn  路  5Comments

silvioprog picture silvioprog  路  5Comments

yazaddaruvala picture yazaddaruvala  路  5Comments

apiraino picture apiraino  路  3Comments

jeprojects picture jeprojects  路  3Comments