S
S
Stepan Sidorov2020-08-10 11:02:44
Python
Stepan Sidorov, 2020-08-10 11:02:44

How to update x-xsrf-token for subsequent request?

Hello.
I'm sending a request to a site containing a UserAgent, a cookie, and an x-xsrf-token. The site sends a response, everything is fine.
But here's the problem with the x-xsrf-token, every Monday, the function stops working and the server returns 403. I go to the site, copy the x-xsrf-token, paste it into the request, and everything works again.
Is it possible to do the same, only automatic? THOSE. renew your x-xsrf-token?
Thank you!

headers={
                "cookie":"куки :O",
                "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.3",
                "x-xsrf-token": "4f65rEkU-686RJheco5QlmM7F1fl8Aq89BA0",

            }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Tikhonov, 2020-08-20
@tumbler

Find out how the site affixes/generates the token itself and reproduce the same algorithm on your site.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question