diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-07-17 09:37:57 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-07-22 15:30:51 +0200 |
commit | 4617ab8a3a981f3abd8d62b561c80f9ad141e57b (patch) | |
tree | 714bedbc37b482f4b24019f910309d48aaa5a2c1 /netlib/http/semantics.py | |
parent | 808b294865257fc3f52b33ed2a796009658b126f (diff) | |
download | mitmproxy-4617ab8a3a981f3abd8d62b561c80f9ad141e57b.tar.gz mitmproxy-4617ab8a3a981f3abd8d62b561c80f9ad141e57b.tar.bz2 mitmproxy-4617ab8a3a981f3abd8d62b561c80f9ad141e57b.zip |
add Request class and unify read_request interface
Diffstat (limited to 'netlib/http/semantics.py')
-rw-r--r-- | netlib/http/semantics.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/netlib/http/semantics.py b/netlib/http/semantics.py index a62c93e3..9a010318 100644 --- a/netlib/http/semantics.py +++ b/netlib/http/semantics.py @@ -7,6 +7,37 @@ import urlparse from .. import utils +class Request(object): + + def __init__( + self, + form_in, + method, + scheme, + host, + port, + path, + httpversion, + headers, + content, + ): + self.form_in = form_in + self.method = method + self.scheme = scheme + self.host = host + self.port = port + self.path = path + self.httpversion = httpversion + self.headers = headers + self.content = content + + def __eq__(self, other): + return self.__dict__ == other.__dict__ + + def __repr__(self): + return "Request(%s - %s, %s)" % (self.method, self.host, self.path) + + class Response(object): def __init__( |