Lines Matching defs:http

6 import http.server
30 # Loopback http server infrastructure
32 class LoopbackHttpServer(http.server.HTTPServer):
38 http.server.HTTPServer.__init__(self,
59 """Stoppable thread that runs a loopback http server."""
206 class BasicAuthHandler(http.server.BaseHTTPRequestHandler):
216 http.server.BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
250 class FakeProxyHandler(http.server.BaseHTTPRequestHandler):
261 http.server.BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
270 self.path, "http")
296 self.server_url = 'http://127.0.0.1:%s' % self.server.port
325 URL = "http://localhost"
352 proxy_url = "http://127.0.0.1:%d" % self.server.port
353 handler = urllib.request.ProxyHandler({"http" : proxy_url})
403 class FakeHTTPRequestHandler(http.server.BaseHTTPRequestHandler):
511 (302, [("Location", "http://localhost:%(port)s/somewhere_else")],
517 data = self.urlopen("http://localhost:%s/" % handler.port)
532 data = self.urlopen("http://localhost:%s/" % handler.port)
540 self.urlopen("http://localhost:%s/weeble" % handler.port)
553 data = self.urlopen("http://localhost:%s/bizarre" % handler.port)
560 data = self.urlopen("http://localhost:%s/bizarre" % handler.port,
614 req = urllib.request.Request("http://localhost:%s/" % handler.port,
622 req = urllib.request.Request("http://localhost:%s/" % handler.port,
631 with urllib.request.urlopen("http://localhost:%s" % handler.port) as open_url:
640 "http://localhost:%s" % handler.port)
651 open_url = urllib.request.urlopen("http://localhost:%s" % handler.port)
654 self.assertEqual(url, "http://localhost:%s" % handler.port)
659 data = urllib.request.urlopen("http://localhost:%s" % handler.port)
667 data = urllib.request.urlopen("http://localhost:%s" % handler.port)
683 request = urllib.request.Request("http://localhost:%s" % handler.port)