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