0

I have a curl command that works fine with --resolve, but can't figure out the equivalent with Requests. (If there is one.)

Simplified example:

URL: 192:168.1.1
Socket: 9999
User: fred
Password for fred: 123456
Path to resolve:  https://number.street.city:9999/mypath/info

Curl command:

curl -v -u fred:123456 -k -H "Content-Type: application/json"
     --resolve number.street.city:9999:192.168.1.1 
     https://number.street.city:9999/mypath/info

I'm guessing session.resolve_redirects has an answer, but I don't know how. Any help is appreciated.

Deezle
  • 11
  • 1
  • 6
  • `requests.get(..., allow_redirects=True)`? – cs95 Jul 19 '17 at 08:00
  • Related: [Python 'requests' library - define specific DNS?](https://stackoverflow.com/q/22609385/846892) – Ashwini Chaudhary Jul 19 '17 at 08:12
  • `--resolve` has nothing to do with redirects; `--resolve` bypasses DNS lookups and tells `curl` to use a specific IP address instead. See the duplicate on how to make requests use a fixed IP address instead of a DNS lookup. – Martijn Pieters Jul 19 '17 at 08:13

0 Answers0