I have the following working curl command:
curl -x http://<PROXY URL>:3128 -u myUsername 'https://logs.company.net/daily-2017.04.13/_search?pretty' -d '{BIG JSON BLOB}
I am trying to convert that into python using the requests library. Here is what I have so far:
json_string = '''{BIG JSON BLOB}'''
print(json_string)
mydict = json.loads(json_string) # obj now contains a dict of the data
proxies = {"http" : "http://<proxy url>:3128"}
r = requests.get("https://logs.company.net/daily-2017.04.13/_search?pretty", data=json_string,auth=(self.username, self.password), proxies=proxies, verify= False) #
print(r.status_code, r.reason)
print(str(r.content))
From what I understand this is basically identical to the above, but it times out on my test server when the curl command does not.
Does anyone know what the problem is here or how I can debug it? I could have hacked in the curl command using the subprocess module but I am pretty new to debugging networking stuff and I want to learn why it is not working hence deciding to ask here.
Thanks!