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)
| 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) |
no test coverage detected