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

Method send_dict

slack_sdk/webhook/client.py:127–140  ·  view source on GitHub ↗

Performs a Slack API request and returns the result. Args: body: JSON data structure (it's still a dict at this point), if you give this argument, body_params and files will be skipped headers: Request headers to append only for this request R

(self, body: Dict[str, Any], headers: Optional[Dict[str, str]] = None)

Source from the content-addressed store, hash-verified

125 )
126
127 def send_dict(self, body: Dict[str, Any], headers: Optional[Dict[str, str]] = None) -> WebhookResponse:
128 """Performs a Slack API request and returns the result.
129
130 Args:
131 body: JSON data structure (it's still a dict at this point),
132 if you give this argument, body_params and files will be skipped
133 headers: Request headers to append only for this request
134 Returns:
135 Webhook response
136 """
137 return self._perform_http_request(
138 body=_build_body(body), # type: ignore[arg-type]
139 headers=_build_request_headers(self.default_headers, headers),
140 )
141
142 def _perform_http_request(self, *, body: Dict[str, Any], headers: Dict[str, str]) -> WebhookResponse:
143 raw_body = json.dumps(body)

Callers 1

sendMethod · 0.95

Calls 3

_perform_http_requestMethod · 0.95
_build_bodyFunction · 0.70
_build_request_headersFunction · 0.70

Tested by

no test coverage detected