MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / parse_body

Function parse_body

notify.py:935–949  ·  view source on GitHub ↗
(body, content_type, value_format_fn=None)

Source from the content-addressed store, hash-verified

933
934
935def 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
952def custom_notify(title: str, content: str) -> None:

Callers 1

custom_notifyFunction · 0.70

Calls 1

parse_stringFunction · 0.70

Tested by

no test coverage detected