POST without reloading the entire web page

I am trying to create a simple post method with a module requests, for example:

 s=requests.Session() 

 s.post(link,data=payload)

To do this correctly, the payload is the identifier of the page itself and is generated each time the page is accessed.

So I need to READ without reloading the whole webpage so that I can get the correct id.

+4
source share
1 answer

Is this code in a view?

If so, I would advise you to create an Ajax view receiving this POST and send the payload from the page using javascript as Ajax.

, .

+1

Source: https://habr.com/ru/post/1608161/


All Articles