MCPcopy
hub / github.com/postmanlabs/httpbin / get_headers

Function get_headers

httpbin/helpers.py:128–140  ·  view source on GitHub ↗

Returns headers dict from request context.

(hide_env=True)

Source from the content-addressed store, hash-verified

126
127
128def get_headers(hide_env=True):
129 """Returns headers dict from request context."""
130
131 headers = dict(request.headers.items())
132
133 if hide_env and ('show_env' not in request.args):
134 for key in ENV_HEADERS:
135 try:
136 del headers[key]
137 except KeyError:
138 pass
139
140 return CaseInsensitiveDict(headers.items())
141
142
143def semiflatten(multi):

Callers 4

view_user_agentFunction · 0.85
range_requestFunction · 0.85
imageFunction · 0.85
get_dictFunction · 0.85

Calls 1

CaseInsensitiveDictClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…