flip_api.utils.http =================== .. py:module:: flip_api.utils.http .. autoapi-nested-parse:: HTTP utilities for internal service-to-service calls on the central hub. Used exclusively by the FL service to communicate with FL Net API endpoints (e.g. flip-fl-api-net-1:8000). These are plain HTTP calls between co-located Docker services — no TLS required. NOT used for hub↔trust communication, which is handled via the task polling system (trusts poll the hub; see private_services/trust_tasks.py). Functions --------- .. autoapisummary:: flip_api.utils.http.http_get flip_api.utils.http.http_post flip_api.utils.http.http_delete Module Contents --------------- .. py:function:: http_get(url: str, request_id: str | None = None) -> Any Perform an HTTP GET request to the specified URL with optional request ID for tracing. :param url: The URL to GET. :type url: str :param request_id: Optional value for the ``x-request-id`` header used for distributed tracing. :type request_id: str | None :returns: Parsed JSON body when the response is JSON; otherwise the raw response text. :rtype: Any :raises httpx.RequestError: If the request cannot be sent (connection, timeout, etc.). :raises httpx.HTTPStatusError: If the response status is 4xx/5xx (via ``raise_for_status``). .. py:function:: http_post(url: str, request_id: str | None = None, data: dict | None = None, timeout: float | None = None) -> Any Perform an HTTP POST request to the specified URL with optional request ID for tracing. :param url: The URL to POST to. :type url: str :param request_id: Optional value for the ``x-request-id`` header used for distributed tracing. :type request_id: str | None :param data: JSON-serialisable body to send. :type data: dict | None :param timeout: Optional request timeout in seconds. When None, httpx defaults are used. :type timeout: float | None :returns: Parsed JSON body when the response is JSON; otherwise the raw response text. :rtype: Any :raises httpx.RequestError: If the request cannot be sent (connection, timeout, etc.). :raises httpx.HTTPStatusError: If the response status is 4xx/5xx (via ``raise_for_status``). .. py:function:: http_delete(url: str, request_id: str | None = None) -> Any Perform an HTTP DELETE request to the specified URL with optional request ID for tracing. :param url: The URL to DELETE. :type url: str :param request_id: Optional value for the ``x-request-id`` header used for distributed tracing. :type request_id: str | None :returns: Parsed JSON body when the response is JSON; otherwise the raw response text. :rtype: Any :raises httpx.RequestError: If the request cannot be sent (connection, timeout, etc.). :raises httpx.HTTPStatusError: If the response status is 4xx/5xx (via ``raise_for_status``).