MCPcopy Create free account
hub / github.com/EasyIME/PIME / raw_fetch

Method raw_fetch

python/python3/tornado/test/httpserver_test.py:255–269  ·  view source on GitHub ↗
(self, headers, body, newline=b"\r\n")

Source from the content-addressed store, hash-verified

253 return Application(self.get_handlers())
254
255 def raw_fetch(self, headers, body, newline=b"\r\n"):
256 with closing(IOStream(socket.socket())) as stream:
257 self.io_loop.run_sync(
258 lambda: stream.connect(("127.0.0.1", self.get_http_port()))
259 )
260 stream.write(
261 newline.join(headers + [utf8("Content-Length: %d" % len(body))])
262 + newline
263 + newline
264 + body
265 )
266 start_line, headers, body = self.io_loop.run_sync(
267 lambda: read_stream_body(stream)
268 )
269 return body
270
271 def test_multipart_form(self):
272 # Encodings here are tricky: Headers are latin1, bodies can be

Callers 2

test_multipart_formMethod · 0.95
test_newlinesMethod · 0.95

Calls 8

IOStreamClass · 0.90
utf8Function · 0.90
read_stream_bodyFunction · 0.85
run_syncMethod · 0.80
get_http_portMethod · 0.80
joinMethod · 0.80
connectMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected