MCPcopy Create free account
hub / github.com/google/adk-python / post_request

Function post_request

contributing/samples/adk_team/adk_stale_agent/utils.py:123–141  ·  view source on GitHub ↗

Sends a POST 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)

Source from the content-addressed store, hash-verified

121
122
123def post_request(url: str, payload: Any) -> Any:
124 """
125 Sends a POST request to the GitHub API with automatic retries.
126
127 Args:
128 url (str): The URL endpoint.
129 payload (Any): The JSON payload.
130
131 Returns:
132 Any: The JSON response.
133 """
134 _increment_api_call_count()
135 try:
136 response = _session.post(url, json=payload, timeout=60)
137 response.raise_for_status()
138 return response.json()
139 except requests.exceptions.RequestException as e:
140 logger.error(f"POST request failed for {url}: {e}")
141 raise
142
143
144def patch_request(url: str, payload: Any) -> Any:

Callers 5

_fetch_graphql_dataFunction · 0.90
add_label_to_issueFunction · 0.90
alert_maintainer_of_editFunction · 0.90
close_as_staleFunction · 0.90

Calls 5

postMethod · 0.80
jsonMethod · 0.80
raise_for_statusMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected