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

Method send_dict

slack_sdk/webhook/async_client.py:136–149  ·  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

134 )
135
136 async def send_dict(self, body: Dict[str, Any], headers: Optional[Dict[str, str]] = None) -> WebhookResponse:
137 """Performs a Slack API request and returns the result.
138
139 Args:
140 body: JSON data structure (it's still a dict at this point),
141 if you give this argument, body_params and files will be skipped
142 headers: Request headers to append only for this request
143 Returns:
144 Webhook response
145 """
146 return await self._perform_http_request(
147 body=_build_body(body), # type: ignore[arg-type]
148 headers=_build_request_headers(self.default_headers, headers),
149 )
150
151 async def _perform_http_request(self, *, body: Dict[str, Any], headers: Dict[str, str]) -> WebhookResponse:
152 str_body: str = 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