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

Method _parse_request

Lib/test/test_httplib.py:546–557  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

544 yield line
545
546 def _parse_request(self, data):
547 lines = data.split(b'\r\n')
548 request = lines[0]
549 headers = {}
550 n = 1
551 while n < len(lines) and len(lines[n]) > 0:
552 key, val = lines[n].split(b':')
553 key = key.decode('latin-1').strip()
554 headers[key] = val.decode('latin-1').strip()
555 n += 1
556
557 return request, headers, b'\r\n'.join(lines[n + 1:])
558
559 def _parse_chunked(self, data):
560 body = []

Callers 4

test_explicit_headersMethod · 0.95
test_requestMethod · 0.95
test_empty_bodyMethod · 0.95

Calls 4

splitMethod · 0.45
stripMethod · 0.45
decodeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected