MCPcopy
hub / github.com/mitmproxy/mitmproxy / to_json

Method to_json

mitmproxy/dns.py:43–52  ·  view source on GitHub ↗

Converts the question into json for mitmweb. Sync with web/src/flow.ts.

(self)

Source from the content-addressed store, hash-verified

41 return self.name
42
43 def to_json(self) -> dict:
44 """
45 Converts the question into json for mitmweb.
46 Sync with web/src/flow.ts.
47 """
48 return {
49 "name": self.name,
50 "type": types.to_str(self.type),
51 "class": classes.to_str(self.class_),
52 }
53
54 @classmethod
55 def from_json(cls, data: dict[str, str]) -> Self:

Callers 8

test_to_jsonMethod · 0.45
test_from_jsonMethod · 0.45
test_makeFunction · 0.45
test_tun_modeFunction · 0.45
test_tun_mode_mockedFunction · 0.45
_data_jsonMethod · 0.45
to_jsonMethod · 0.45

Calls

no outgoing calls

Tested by 6

test_to_jsonMethod · 0.36
test_from_jsonMethod · 0.36
test_makeFunction · 0.36
test_tun_modeFunction · 0.36
test_tun_mode_mockedFunction · 0.36