diff options
author | Georg Brandl <georg@python.org> | 2008-05-26 16:32:26 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-05-26 16:32:26 (GMT) |
commit | 2442015af26321083d4a2d75c096c8b732f049b2 (patch) | |
tree | 24cb8bc1fd46815ecc6e795cfcc008e7a576c672 /Lib/xmlrpc | |
parent | 744c2cd32585c1aeb1b78063cc6dda740d59c0c0 (diff) | |
download | cpython-2442015af26321083d4a2d75c096c8b732f049b2.zip cpython-2442015af26321083d4a2d75c096c8b732f049b2.tar.gz cpython-2442015af26321083d4a2d75c096c8b732f049b2.tar.bz2 |
Create http package. #2883.
Diffstat (limited to 'Lib/xmlrpc')
-rw-r--r-- | Lib/xmlrpc/client.py | 8 | ||||
-rw-r--r-- | Lib/xmlrpc/server.py | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py index 138d86d..43e7a6c 100644 --- a/Lib/xmlrpc/client.py +++ b/Lib/xmlrpc/client.py @@ -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 = {} diff --git a/Lib/xmlrpc/server.py b/Lib/xmlrpc/server.py index 9668c8c..4ddc004 100644 --- a/Lib/xmlrpc/server.py +++ b/Lib/xmlrpc/server.py @@ -105,8 +105,9 @@ server.handle_request() # Based on code written by Fredrik Lundh. from xmlrpc.client import Fault, dumps, loads +from http.server import BaseHTTPRequestHandler +import http.server import socketserver -import BaseHTTPServer import sys import os import re @@ -408,7 +409,7 @@ class SimpleXMLRPCDispatcher: else: raise Exception('method "%s" is not supported' % method) -class SimpleXMLRPCRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): +class SimpleXMLRPCRequestHandler(BaseHTTPRequestHandler): """Simple XML-RPC request handler class. Handles all HTTP POST requests and attempts to decode them as @@ -500,7 +501,7 @@ class SimpleXMLRPCRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): """Selectively log an accepted request.""" if self.server.logRequests: - BaseHTTPServer.BaseHTTPRequestHandler.log_request(self, code, size) + BaseHTTPRequestHandler.log_request(self, code, size) class SimpleXMLRPCServer(socketserver.TCPServer, SimpleXMLRPCDispatcher): @@ -560,10 +561,9 @@ class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher): """ code = 400 - message, explain = \ - BaseHTTPServer.BaseHTTPRequestHandler.responses[code] + message, explain = BaseHTTPRequestHandler.responses[code] - response = BaseHTTPServer.DEFAULT_ERROR_MESSAGE % \ + response = http.server.DEFAULT_ERROR_MESSAGE % \ { 'code' : code, 'message' : message, |