I'm trying to get a webpage using a company's API, it works perfectly in Postman but when I take the code generated by Postman into python requests it returns a different response.
I set up my proxy and added my base auth but it still won't work
url = "https://www.test.com/confluence/rest/api/content/<id>"
querystring = {"expand":"space,body.view,version,container"}
headers = {
'Content-Type': "application/json",
'Authorization': "****",
'User-Agent': "PostmanRuntime/7.15.2",
'Accept': "*/*",
'Cache-Control': "no-cache",
'Postman-Token': "****",
'Host': "www.test.com",
'Cookie': "****",
'Accept-Encoding': "gzip, deflate",
'Connection': "keep-alive",
'cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers, params=querystring, proxies=urllib.request.getproxies())
Postman returns a JSON response containing the entire webpage + ID and any other necessary info. Python returns an HTML webpage with this error embedded
JavaScript is either disabled in or not supported by the Web browser.
To continue logon, use a Web browser that supports JavaScript or enable JavaScript in your current browser.