first , im just starting on http requests , im trying to learn automation using http requests , due to its speed . well i installed the requests lib , on python and tried some simple sites with GET and POST method , all was fine , since they was simple and i didnt needed to add any requests headers on the request and the payloads was data login so simple .
However , now i'm trying a new POST example on this site Here is the link , the Payloads are simple just a phone number country code and return url , as you can see in the screenshot
Payloads
but the request always failed , then i tried to add some request headers that i found when inspecting the post like those ones highlighted in yellow in the image below ,some are stable which was easy and
and for requestverificationtoken request header i had to parse the html after the GET method to get it , and i added content-type as well .
-and now , im not sure if the way im sending the Payloads is incorrect ( because i followed tutorial that showed data form sending and im doing it the same way ) , where mine are called just requests payloads .
-or maybe i need to add the Request-ID header request seen on the screnshot above which is not availblae on HTML , but i think its calculated on JS , and i would really love if someone can help me retrieve its value from the JS files . SEE This image Request-Id javascripts
to reproduce , just visit the link above , put a phone number and click next and inspect the network .
and here is my PYTHON script , My python script
thanks in advance , i would appreciate any help on how to parse js and get the value of request-id , or if any ideas comes up on what may be wrong , please tell me !
Problem : Tried to do a post request , expected to recieve AN SMS And a successful POST request But not working probably of headers missing or payload data sent the wrong way.