MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / dispatcharr_http_headers

Function dispatcharr_http_headers

core/utils.py:36–48  ·  view source on GitHub ↗

Build HTTP headers for outbound Dispatcharr requests. content_type=None omits Content-Type (e.g. simple GET proxies). token is included when authenticating with Schedules Direct.

(*, token=None, content_type='application/json')

Source from the content-addressed store, hash-verified

34
35
36def dispatcharr_http_headers(*, token=None, content_type='application/json'):
37 """
38 Build HTTP headers for outbound Dispatcharr requests.
39
40 content_type=None omits Content-Type (e.g. simple GET proxies).
41 token is included when authenticating with Schedules Direct.
42 """
43 headers = {'User-Agent': dispatcharr_user_agent()}
44 if content_type:
45 headers['Content-Type'] = content_type
46 if token:
47 headers['token'] = token
48 return headers
49
50
51def natural_sort_key(text):

Callers 9

check_for_version_updateFunction · 0.90
_sd_headersFunction · 0.90
_sd_authenticateMethod · 0.90
_fetch_sd_countriesMethod · 0.90
sd_lineupsMethod · 0.90
sd_lineups_searchMethod · 0.90
posterMethod · 0.90

Calls 1

dispatcharr_user_agentFunction · 0.85