I am using requests and I'm trying to get the response (as seen on Network tab on chrome)
url = r"https://wwww.mylocal.com/345523"
authKey = base64.b64encode("testu:pwd$u")
headers = {"Content-Type":"application/json", "Authorization":"Basic " + "YWRtaW46OWJKTmp5WUxKc1A0dlJ1dTd2Mk0"}
data = { "id":444}
r = requests.get(url, headers=headers, params = data)
print r.content
But I keep getting the HTML of the page and I want to get actual response. When using r.content I get a message that object cannot be decoded, which makes sense since r.content retrieves the source code instead of actual response. Is there a way to get that?
The response I see on network tab is similar to:
{"search_results": {"@xmlns": "http://mylocal.com/345523", "ColorsInfo": {"bgColor": "552448"}}
And what I want to retrieve is the value of bgcolor but on r.content I get the Html content of the page.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
...and so on