MCPcopy Create free account
hub / github.com/slackapi/python-slack-sdk / _build_request_headers

Function _build_request_headers

slack_sdk/webhook/internal_utils.py:19–35  ·  view source on GitHub ↗
(
    default_headers: Dict[str, str],
    additional_headers: Optional[Dict[str, str]],
)

Source from the content-addressed store, hash-verified

17
18
19def _build_request_headers(
20 default_headers: Dict[str, str],
21 additional_headers: Optional[Dict[str, str]],
22) -> Dict[str, str]:
23 if default_headers is None and additional_headers is None:
24 return {}
25
26 request_headers = {
27 "Content-Type": "application/json;charset=utf-8",
28 }
29 if default_headers is None or "User-Agent" not in default_headers:
30 request_headers["User-Agent"] = get_user_agent()
31
32 request_headers.update(default_headers)
33 if additional_headers:
34 request_headers.update(additional_headers)
35 return request_headers
36
37
38def _debug_log_response(logger, resp: WebhookResponse) -> None:

Callers 2

send_dictMethod · 0.70
send_dictMethod · 0.70

Calls 1

get_user_agentFunction · 0.90

Tested by

no test coverage detected