Sends a PATCH request to the GitHub API with automatic retries. Args: url (str): The URL endpoint. payload (Any): The JSON payload. Returns: Any: The JSON response.
(url: str, payload: Any)
| 142 | |
| 143 | |
| 144 | def patch_request(url: str, payload: Any) -> Any: |
| 145 | """ |
| 146 | Sends a PATCH request to the GitHub API with automatic retries. |
| 147 | |
| 148 | Args: |
| 149 | url (str): The URL endpoint. |
| 150 | payload (Any): The JSON payload. |
| 151 | |
| 152 | Returns: |
| 153 | Any: The JSON response. |
| 154 | """ |
| 155 | _increment_api_call_count() |
| 156 | try: |
| 157 | response = _session.patch(url, json=payload, timeout=60) |
| 158 | response.raise_for_status() |
| 159 | return response.json() |
| 160 | except requests.exceptions.RequestException as e: |
| 161 | logger.error(f"PATCH request failed for {url}: {e}") |
| 162 | raise |
| 163 | |
| 164 | |
| 165 | def delete_request(url: str) -> Any: |
no test coverage detected