(self)
| 112 | return "http://%s%s" % (host, self.path) |
| 113 | |
| 114 | def toDict(self): |
| 115 | out = { |
| 116 | "httpVersion": self.httpVersion, |
| 117 | "method": self.method, |
| 118 | "url": self.url, |
| 119 | "headers": [dict(name=key.capitalize(), value=value) for key, value in self.headers.items()], |
| 120 | "cookies": [], |
| 121 | "queryString": [], |
| 122 | "headersSize": -1, |
| 123 | "bodySize": -1, |
| 124 | "comment": getText(self.comment), |
| 125 | } |
| 126 | |
| 127 | if self.postBody: |
| 128 | contentType = self.headers.get("Content-Type") |
| 129 | out["postData"] = { |
| 130 | "mimeType": contentType, |
| 131 | "text": getText(self.postBody).rstrip("\r\n"), |
| 132 | } |
| 133 | |
| 134 | return out |
| 135 | |
| 136 | class Response(object): |
| 137 | extract_status = re.compile(b'\\((\\d{3}) (.*)\\)') |
nothing calls this directly
no test coverage detected