(body, content_type, value_format_fn=None)
| 933 | |
| 934 | |
| 935 | def parse_body(body, content_type, value_format_fn=None): |
| 936 | if not body or content_type == "text/plain": |
| 937 | return value_format_fn(body) if value_format_fn and body else body |
| 938 | |
| 939 | parsed = parse_string(body, value_format_fn) |
| 940 | |
| 941 | if content_type == "application/x-www-form-urlencoded": |
| 942 | data = urllib.parse.urlencode(parsed, doseq=True) |
| 943 | return data |
| 944 | |
| 945 | if content_type == "application/json": |
| 946 | data = json.dumps(parsed) |
| 947 | return data |
| 948 | |
| 949 | return parsed |
| 950 | |
| 951 | |
| 952 | def custom_notify(title: str, content: str) -> None: |
no test coverage detected