Answers for "python requests force ipv4"

1

python requests force ipv4

import socket
import requests.packages.urllib3.util.connection as urllib3_cn
 
def allowed_gai_family():
    family = socket.AF_INET    # force IPv4
    return family
 
urllib3_cn.allowed_gai_family = allowed_gai_family
Posted by: Guest on July-24-2020

Python Answers by Framework

Browse Popular Code Answers by Language