MCPcopy
hub / github.com/mitmproxy/mitmproxy / _set_urlencoded_form

Method _set_urlencoded_form

mitmproxy/http.py:941–947  ·  view source on GitHub ↗

Sets the body to the URL-encoded form data, and adds the appropriate content-type header. This will overwrite the existing content if there is one.

(self, form_data: Sequence[tuple[str, str]])

Source from the content-addressed store, hash-verified

939 return ()
940
941 def _set_urlencoded_form(self, form_data: Sequence[tuple[str, str]]) -> None:
942 """
943 Sets the body to the URL-encoded form data, and adds the appropriate content-type header.
944 This will overwrite the existing content if there is one.
945 """
946 self.headers["content-type"] = "application/x-www-form-urlencoded"
947 self.content = url.encode(form_data, self.get_text(strict=False)).encode()
948
949 @property
950 def urlencoded_form(self) -> multidict.MultiDictView[str, str]:

Callers 1

urlencoded_formMethod · 0.95

Calls 2

encodeMethod · 0.45
get_textMethod · 0.45

Tested by

no test coverage detected