mopidy.httpclient — HTTP Client helpers

mopidy.httpclient.format_proxy(proxy_config, auth=True)[source]

Convert a Mopidy proxy config to the commonly used proxy string format.

Outputs scheme://host:port, scheme://user:pass@host:port or None depending on the proxy config provided.

You can also opt out of getting the basic auth by setting auth to False.

New in version 1.1.

mopidy.httpclient.format_user_agent(name=None)[source]

Construct a User-Agent suitable for use in client code.

This will identify use by the provided name (which should be on the format dist_name/version), Mopidy version and Python version.

New in version 1.1.