예제 #1
0
 def __init__(self, inp=None, method=None, path=None):
     BaseHttp.__init__(self)
     if inp is not None:
         self.read_content(inp)
     self.method = method or 'GET'
     if path is not None:
         self.path = path if not isinstance(path, bytes) else path.decode()
예제 #2
0
 def __init__(self, inp=None, method=None, path=None):
     BaseHttp.__init__(self)
     if inp is not None:
         self.read_content(inp)
     self.method = method or 'GET'
     if path is not None:
         self.path = path if not isinstance(path, bytes) else path.decode()
예제 #3
0
 def read_content(self, data):
     if data is None or len(data) == 0:
         return 0
     hdr = self.header.finished
     rv = BaseHttp.read_content(self, data)
     if hdr is False and self.header.finished:
         self.method, self.path, self.http = self.header.status_line.split(' ')
     return rv
예제 #4
0
 def read_content(self, data):
     if data is None or len(data) == 0:
         return 0
     hdr = self.header.finished
     rv = BaseHttp.read_content(self, data)
     if hdr is False and self.header.finished:
         self.method, self.path, self.http = self.header.status_line.split(
             ' ')
     return rv
예제 #5
0
 def read_content(self, data):
     if data is None or len(data) == 0:
         return 0
     hdr = self.header.finished
     rv = BaseHttp.read_content(self, data)
     if hdr is False and self.header.finished:
         self.http, self.code, self.msg = self.header.status_line.split(' ', 2)
         self.code = int(self.code)
     return rv
예제 #6
0
 def read_content(self, data):
     if data is None or len(data) == 0:
         return 0
     hdr = self.header.finished
     rv = BaseHttp.read_content(self, data)
     if hdr is False and self.header.finished:
         self.http, self.code, self.msg = self.header.status_line.split(
             ' ', 2)
         self.code = int(self.code)
     return rv
예제 #7
0
 def __init__(self, inp=None, code=None):
     BaseHttp.__init__(self)
     self.msg = 'OK'
     self.code = code or 200
     if inp is not None:
         self.read_content(inp)
예제 #8
0
 def __init__(self, inp=None, code=None):
     BaseHttp.__init__(self)
     self.msg = 'OK'
     self.code = code or 200
     if inp is not None:
         self.read_content(inp)