trust_api.utils.http ==================== .. py:module:: trust_api.utils.http Functions --------- .. autoapisummary:: trust_api.utils.http.make_request Module Contents --------------- .. py:function:: make_request(method: str, url: str, *, json_body: dict | None = None, params: dict | None = None, headers: dict | None = None, timeout_seconds: float = 30.0, follow_redirects: bool = True) -> dict[str, Any] :async: Utility function to help make HTTP requests to external APIs. :param method: HTTP method (GET, POST, etc.) :type method: str :param url: URL of the external API :type url: str :param json_body: Request body content :type json_body: dict | None :param params: Query parameters for the request :type params: dict | None :param headers: Headers for the request :type headers: dict | None :param timeout_seconds: Timeout for the request in seconds :type timeout_seconds: float :param follow_redirects: Whether to follow redirects :type follow_redirects: bool :returns: JSON response from the external API :rtype: dict[str, Any] :raises HTTPException: If there is an error during the request or if the response is not JSON