Making Python requests using a proxy without speci

2019-07-13 17:21发布

Is there a way to make requests in Python using the Windows/NTLM ProxyUseDefaultCredentials ? Making https requests in Python using a proxy without having to specify a username and password for the proxy.

This works in powershell, note the flag at the end:

Invoke-WebRequest -Uri $uri -Headers $Headers -Body $Payloadjson -Method Post -Proxy 'http://myproxy.com:80' -ProxyUseDefaultCredentials

Is there a similar code i can do in python ?

proxies = {
  'http': 'myproxy.com:80',
  'https': 'myproxy.com:80'
}

res = requests.post(MY_URI, headers = headers, data = json.dumps(payload), proxies=proxies)

0条回答
登录 后发表回答