MCPcopy Index your code
hub / github.com/python/cpython / http_open

Method http_open

Lib/test/test_urllib2.py:1407–1417  ·  view source on GitHub ↗
(self, req)

Source from the content-addressed store, hash-verified

1405 # but most ASCII characters should be treated as already encoded
1406 class Handler(urllib.request.HTTPHandler):
1407 def http_open(self, req):
1408 result = self.do_open(self.connection, req)
1409 self.last_buf = self.connection.buf
1410 # Set up a normal response for the next request
1411 self.connection = test_urllib.fakehttp(
1412 b'HTTP/1.1 200 OK\r\n'
1413 b'Content-Length: 3\r\n'
1414 b'\r\n'
1415 b'123'
1416 )
1417 return result
1418 handler = Handler()
1419 opener = urllib.request.build_opener(handler)
1420 tests = (

Callers

nothing calls this directly

Calls 2

do_openMethod · 0.80
fakehttpMethod · 0.80

Tested by

no test coverage detected