mopidy.httpclient — HTTP Client helpers — Mopidy 4.0.0a2 documentation

# `mopidy.httpclient` — HTTP Client helpers

Helpers for configuring HTTP clients used in Mopidy extensions.

mopidy.httpclient.format_proxy(proxy_config, auth=True) → str | None

  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`.

  Added in version 1.1.

  Return type:

    `str` | `None`

mopidy.httpclient.format_user_agent(name=None) → str

  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.

  Added in version 1.1.

  Return type:

    `str`