mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Create http package. #2883.
This commit is contained in:
parent
744c2cd325
commit
2442015af2
50 changed files with 930 additions and 1203 deletions
|
@ -135,7 +135,7 @@ Exported functions:
|
|||
"""
|
||||
|
||||
import re, time, operator
|
||||
import httplib
|
||||
import http.client
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# Internal stuff
|
||||
|
@ -1196,7 +1196,7 @@ class Transport:
|
|||
|
||||
def send_request(self, host, handler, request_body, debug):
|
||||
host, extra_headers, x509 = self.get_host_info(host)
|
||||
connection = httplib.HTTPConnection(host)
|
||||
connection = http.client.HTTPConnection(host)
|
||||
if debug:
|
||||
connection.set_debuglevel(1)
|
||||
headers = {}
|
||||
|
@ -1261,10 +1261,10 @@ class SafeTransport(Transport):
|
|||
import socket
|
||||
if not hasattr(socket, "ssl"):
|
||||
raise NotImplementedError(
|
||||
"your version of httplib doesn't support HTTPS")
|
||||
"your version of http.client doesn't support HTTPS")
|
||||
|
||||
host, extra_headers, x509 = self.get_host_info(host)
|
||||
connection = httplib.HTTPSConnection(host, None, **(x509 or {}))
|
||||
connection = http.client.HTTPSConnection(host, None, **(x509 or {}))
|
||||
if debug:
|
||||
connection.set_debuglevel(1)
|
||||
headers = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue