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]])
| 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]: |
no test coverage detected