MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / create

Method create

mitmproxy/addons/view.py:476–492  ·  view source on GitHub ↗
(self, method: str, url: str)

Source from the content-addressed store, hash-verified

474
475 @command.command("view.flows.create")
476 def create(self, method: str, url: str) -> None:
477 try:
478 req = http.Request.make(method.upper(), url)
479 except ValueError as e:
480 raise exceptions.CommandError("Invalid URL: %s" % e)
481
482 c = connection.Client(
483 peername=("", 0),
484 sockname=("", 0),
485 timestamp_start=req.timestamp_start - 0.0001,
486 )
487 s = connection.Server(address=(req.host, req.port))
488
489 f = http.HTTPFlow(c, s)
490 f.request = req
491 f.request.headers["Host"] = req.host
492 self.add([f])
493
494 @command.command("view.flows.load")
495 def load_file(self, path: mitmproxy.types.Path) -> None:

Callers 4

test_createFunction · 0.95
tFunction · 0.45
iFunction · 0.45

Calls 2

addMethod · 0.95
makeMethod · 0.45

Tested by 1

test_createFunction · 0.76