class documentation

class Request:

View In Hierarchy

Undocumented

Static Method delete Send an authenticated DELETE request to HubAI.
Static Method get Send an authenticated GET request to HubAI.
Static Method headers Build authenticated request headers for HubAI API calls.
Static Method patch Send an authenticated PATCH request to HubAI.
Static Method post Send an authenticated POST request to HubAI.
Static Method put Send an authenticated PUT request to HubAI.
Static Method url Build the API base URL for a HubAI service.
Static Method _check_response Raise an HTTP error for non-success responses.
Static Method _get_json Decode a JSON response or raise a readable HTTP error.
Static Method _get_url Join a base API URL with an endpoint path.
Static Method _process_response Validate a response and decode its JSON payload.
@staticmethod
def delete(service: HubService, endpoint: str = '', **kwargs) -> Any:

Send an authenticated DELETE request to HubAI.

@staticmethod
def get(service: HubService, endpoint: str = '', **kwargs) -> Any:

Send an authenticated GET request to HubAI.

@staticmethod
def headers() -> dict[str, str]:

Build authenticated request headers for HubAI API calls.

Returns
dict[str, str]Headers containing the bearer token and JSON accept header.
Raises
ValueErrorIf HUBAI_API_KEY is not configured.
@staticmethod
def patch(service: HubService, endpoint: str = '', **kwargs) -> Any:

Send an authenticated PATCH request to HubAI.

@staticmethod
def post(service: HubService, endpoint: str = '', **kwargs) -> Any:

Send an authenticated POST request to HubAI.

@staticmethod
def put(service: HubService, endpoint: str = '', **kwargs) -> Any:

Send an authenticated PUT request to HubAI.

@staticmethod
def url(service: HubService) -> str:

Build the API base URL for a HubAI service.

@staticmethod
def _check_response(response: Response) -> Response:

Raise an HTTP error for non-success responses.

@staticmethod
def _get_json(response: Response) -> Any:

Decode a JSON response or raise a readable HTTP error.

@staticmethod
def _get_url(endpoint: str, base_url: str | None = None) -> str:

Join a base API URL with an endpoint path.

@staticmethod
def _process_response(response: Response) -> Any:

Validate a response and decode its JSON payload.