(form: FormElement, url: str | None)
| 103 | |
| 104 | |
| 105 | def _get_form_url(form: FormElement, url: str | None) -> str: |
| 106 | assert form.base_url is not None # typing |
| 107 | if url is None: |
| 108 | action = form.get("action") |
| 109 | if action is None: |
| 110 | return form.base_url |
| 111 | return urljoin(form.base_url, strip_html5_whitespace(action)) |
| 112 | return urljoin(form.base_url, url) |
| 113 | |
| 114 | |
| 115 | def _urlencode(seq: Iterable[FormdataKVType], enc: str) -> str: |