aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/http_semantics.py
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2015-07-08 09:20:25 +0200
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2015-07-22 15:30:50 +0200
commit6dcfc35011208f4bfde7f37a63d7b980f6c41ce0 (patch)
tree6478a1b7bf2445419855f0f00415130e87dab7d9 /netlib/http_semantics.py
parente316a9cdb44444667e26938f8c1c3969e56c2f0e (diff)
downloadmitmproxy-6dcfc35011208f4bfde7f37a63d7b980f6c41ce0.tar.gz
mitmproxy-6dcfc35011208f4bfde7f37a63d7b980f6c41ce0.tar.bz2
mitmproxy-6dcfc35011208f4bfde7f37a63d7b980f6c41ce0.zip
introduce http_semantics module
used for generic HTTP representation everything should apply for HTTP/1 and HTTP/2
Diffstat (limited to 'netlib/http_semantics.py')
-rw-r--r--netlib/http_semantics.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/netlib/http_semantics.py b/netlib/http_semantics.py
new file mode 100644
index 00000000..e8313e3c
--- /dev/null
+++ b/netlib/http_semantics.py
@@ -0,0 +1,23 @@
+class Response(object):
+
+ def __init__(
+ self,
+ httpversion,
+ status_code,
+ msg,
+ headers,
+ content,
+ sslinfo=None,
+ ):
+ self.httpversion = httpversion
+ self.status_code = status_code
+ self.msg = msg
+ self.headers = headers
+ self.content = content
+ self.sslinfo = sslinfo
+
+ def __eq__(self, other):
+ return self.__dict__ == other.__dict__
+
+ def __repr__(self):
+ return "Response(%s - %s)" % (self.status_code, self.msg)