Encode a name/value pair within a multipart form.
(name: str, value: str)
| 31 | |
| 32 | |
| 33 | def _format_form_param(name: str, value: str) -> bytes: |
| 34 | class="st">""" |
| 35 | Encode a name/value pair within a multipart form. |
| 36 | class="st">""" |
| 37 | |
| 38 | def replacer(match: typing.Match[str]) -> str: |
| 39 | return _HTML5_FORM_ENCODING_REPLACEMENTS[match.group(0)] |
| 40 | |
| 41 | value = _HTML5_FORM_ENCODING_RE.sub(replacer, value) |
| 42 | return f&class="cm">#x27;{name}=class="st">"{value}"'.encode() |
| 43 | |
| 44 | |
| 45 | def _guess_content_type(filename: str | None) -> str | None: |
no outgoing calls
no test coverage detected