I have to make a POST request to a website using specific Header and Data to complete the operation properly , some of this data could be collected from the HTML code obtained with a GET request to the website. (This is the problem) the rest of data is coming as Ajax not in the http header (I'm not familiar with this), I tried with requests module :
import requests
r=s.get(WebsiteLink,headers=header)
print r.headers
print r.history
and all what I get is just the HTTP header response .
I can see the data I need in the Firefox plugin : Live HTTP Headers , Under Generator tab , I don't understand how , but it seems that Firefox is receiving the data as jQuery* (?) then sending the request with the proper Data , i didn't understood how I can receive them with python .
My header :
header={
'Host': ' www.mywebsite.com',
'User-Agent': " Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0",
'Accept': ' text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': ' en-US,en;q=0.5',
'X-Requested-With': 'XMLHttpRequest',
'Accept-Encoding': ' gzip, deflate',
'Referer': " https://mywebsite.com/",
'Cookie': ' My Cookies',
'Connection': ' keep-alive',
'Content-Type': ' application/x-www-form-urlencoded'
}