Joins the base Slack URL and an API method to form an absolute URL. Args: base_url (str): The base URL api_method (str): The Slack Web API method. e.g. 'chat.postMessage' Returns: The absolute API URL. e.g. 'https://slack.com/api/chat.postMessage'
(base_url: str, api_method: str)
| 58 | |
| 59 | |
| 60 | def _get_url(base_url: str, api_method: str) -> str: |
| 61 | """Joins the base Slack URL and an API method to form an absolute URL. |
| 62 | |
| 63 | Args: |
| 64 | base_url (str): The base URL |
| 65 | api_method (str): The Slack Web API method. e.g. 'chat.postMessage' |
| 66 | |
| 67 | Returns: |
| 68 | The absolute API URL. |
| 69 | e.g. 'https://slack.com/api/chat.postMessage' |
| 70 | """ |
| 71 | # Ensure no leading slash in api_method to prevent double slashes |
| 72 | api_method = api_method.lstrip("/") |
| 73 | return urljoin(base_url, api_method) |
| 74 | |
| 75 | |
| 76 | def _get_headers( |
no outgoing calls