def from_json(cls, json: MutableMapping[str, Any]) \
-> 'RequestReturnedGetNone':
with JsonParser(json):
assert json.pop('messageType', None) == 'request'
return RequestReturnedGetNone(
in_scope=ensure(bool, json.pop('inScope')),
http_version=parse_http_version(json.pop('httpVersion')),
body=b64decode(json.pop('body').encode()),
tool_flag=ensure(int, json.pop('toolFlag')),
url=ensure(str, json.pop('url')),
method=ensure(str, json.pop('method')),
protocol=ensure(str, json.pop('protocol')),
path=ensure(str, json.pop('path')),
headers=tuple(cls.__pop_headers(json)),
port=ensure(int, json.pop('port')),
host=ensure(str, json.pop('host')),
raw=b64decode(json.pop('raw').encode()),
reference_id=ensure(int, json.pop('referenceID')),
query=ensure((str, type(None)), json.pop('query', None)),
)
评论列表
文章目录