http.py (1173:795637f72c1b) http.py (1256:60e5df142860)
1import re
2import socket
3import select
4from unit.main import TestUnit
5
6
7class TestHTTP(TestUnit):
8 def http(self, start_str, **kwargs):

--- 49 unchanged lines hidden (view full) ---

58 return None
59
60 else:
61 sock = kwargs['sock']
62
63 if 'raw' not in kwargs:
64 req = ' '.join([start_str, url, http]) + crlf
65
1import re
2import socket
3import select
4from unit.main import TestUnit
5
6
7class TestHTTP(TestUnit):
8 def http(self, start_str, **kwargs):

--- 49 unchanged lines hidden (view full) ---

58 return None
59
60 else:
61 sock = kwargs['sock']
62
63 if 'raw' not in kwargs:
64 req = ' '.join([start_str, url, http]) + crlf
65
66 if body is not b'':
66 if body != b'':
67 if isinstance(body, str):
68 body = body.encode()
69
70 if 'Content-Length' not in headers:
71 headers['Content-Length'] = len(body)
72
73 for header, value in headers.items():
74 if isinstance(value, list):

--- 106 unchanged lines hidden ---
67 if isinstance(body, str):
68 body = body.encode()
69
70 if 'Content-Length' not in headers:
71 headers['Content-Length'] = len(body)
72
73 for header, value in headers.items():
74 if isinstance(value, list):

--- 106 unchanged lines hidden ---