def json_repr(self): """ self = http.Request """ return { "method": self.msg.method, "url": self.url, "httpVersion": self.msg.version, "cookies": [], "queryString": http.query_json_repr(self.query), "headersSize": -1, "headers": http.header_json_repr(self.msg.headers), "bodySize": len(self.msg.body), }
def json_repr(self): ''' self = http.Request ''' return { 'method': self.msg.method, 'url': self.url, 'httpVersion': self.msg.version, 'cookies': [], 'queryString': http.query_json_repr(self.query), 'headersSize': -1, 'headers': http.header_json_repr(self.msg.headers), 'bodySize': len(self.msg.body), }
def json_repr(self): ''' self = http.Request ''' postData = {} postData['text'] = self.msg.body try: postData['text'] = postData['text'].encode('utf8') except UnicodeDecodeError as e: postData['encoding'] = "base64" postData['text'] = base64.b64encode(self.msg.body) return { 'method': self.msg.method, 'url': self.url, 'httpVersion': self.msg.version, 'cookies': [], 'queryString': http.query_json_repr(self.query), 'headersSize': -1, 'headers': http.header_json_repr(self.msg.headers), 'bodySize': len(self.msg.body), 'postData': postData, }