---
sidebar:
  hidden: true
title: roboto.http
---
Clients and types for sending requests to Roboto over HTTP.

Use [`RobotoClient`](/docs/reference/python-sdk/roboto/http#roboto.http.RobotoClient) to send requests to a chosen Roboto endpoint with a chosen access token or config profile. SDK methods that take a `roboto_client` default to the one client [`from_env()`](/docs/reference/python-sdk/roboto/http#roboto.http.RobotoClient.from_env) builds from the environment and reuses for every call.

## Submodules

- [roboto.http.constants](/docs/reference/python-sdk/roboto/http/constants)
- [roboto.http.headers](/docs/reference/python-sdk/roboto/http/headers)
- [roboto.http.http_client](/docs/reference/python-sdk/roboto/http/http_client)
- [roboto.http.options](/docs/reference/python-sdk/roboto/http/options)
- [roboto.http.request](/docs/reference/python-sdk/roboto/http/request)
- [roboto.http.request_decorators](/docs/reference/python-sdk/roboto/http/request_decorators)
- [roboto.http.requester](/docs/reference/python-sdk/roboto/http/requester)
- [roboto.http.response](/docs/reference/python-sdk/roboto/http/response)
- [roboto.http.retry](/docs/reference/python-sdk/roboto/http/retry)
- [roboto.http.roboto_client](/docs/reference/python-sdk/roboto/http/roboto_client)
- [roboto.http.tls](/docs/reference/python-sdk/roboto/http/tls)
- [roboto.http.url_builder](/docs/reference/python-sdk/roboto/http/url_builder)

## Package Contents

- [BEARER_TOKEN_HEADER](/docs/reference/python-sdk/roboto/http/constants#roboto.http.constants.BEARER_TOKEN_HEADER) (data): `BEARER_TOKEN_HEADER = 'X-Roboto-Bearer-Token'`. Header naming a Roboto bearer token sent alongside a request's own credentials.

- [BatchRequest](/docs/reference/python-sdk/roboto/http/request#roboto.http.request.BatchRequest) (class): Request body for a route that applies several requests of one kind in one call.

- [BatchResponse](/docs/reference/python-sdk/roboto/http/response#roboto.http.response.BatchResponse) (class): Response to a batch request: the outcome of each request element, in the order the request sent them.

- [BatchResponseElement](/docs/reference/python-sdk/roboto/http/response#roboto.http.response.BatchResponseElement) (class): Outcome of one element of a batch request: its result if Roboto applied it, or its exception if refused.

- [BearerTokenDecorator](/docs/reference/python-sdk/roboto/http/request_decorators#roboto.http.request_decorators.BearerTokenDecorator) (class): Request decorator that sends one fixed access token in each request's `Authorization` header.

- [CONNECTION_CONSISTENCY_HEADER](/docs/reference/python-sdk/roboto/http/constants#roboto.http.constants.CONNECTION_CONSISTENCY_HEADER) (data): `CONNECTION_CONSISTENCY_HEADER = 'X-Roboto-Connection-Consistency'`. Header naming whether a query or listing must include the most recent changes.

- [CONTENT_TYPE_JSON_HEADER](/docs/reference/python-sdk/roboto/http/headers#roboto.http.headers.CONTENT_TYPE_JSON_HEADER) (data): Header naming JSON as the request body's content type, as a dictionary to merge into a request's headers.

- [ClientError](/docs/reference/python-sdk/roboto/exceptions/http#roboto.exceptions.http.ClientError) (exception): The server rejected the request and responded with a 4xx status.

- [DEFAULT_HTTP_TIMEOUT](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.DEFAULT_HTTP_TIMEOUT) (data): `DEFAULT_HTTP_TIMEOUT = 30.0`. Seconds a client from `RobotoClient.from_config` waits on each request by default.

- [HttpClient](/docs/reference/python-sdk/roboto/http/http_client#roboto.http.http_client.HttpClient) (class): HTTP client that sends each request with the same headers, authentication, timeout and retry rules.

- [HttpClientOptions](/docs/reference/python-sdk/roboto/http/options#roboto.http.options.HttpClientOptions) (class): Settings of an [`HttpClient`](/docs/reference/python-sdk/roboto/http/http_client#roboto.http.http_client.HttpClient) that apply to every request it makes.

- [HttpError](/docs/reference/python-sdk/roboto/exceptions/http#roboto.exceptions.http.HttpError) (exception): Base class of the exceptions the SDK raises when an HTTP response has an error status.

- [HttpLoggingOptions](/docs/reference/python-sdk/roboto/http/options#roboto.http.options.HttpLoggingOptions) (class): Logging settings of an [`HttpClient`](/docs/reference/python-sdk/roboto/http/http_client#roboto.http.http_client.HttpClient): which parts of a request it hides in its logs.

- [HttpRequest](/docs/reference/python-sdk/roboto/http/request#roboto.http.request.HttpRequest) (class): An HTTP request for [`HttpClient`](/docs/reference/python-sdk/roboto/http/http_client#roboto.http.http_client.HttpClient) to send, with the settings that govern its retries.

- [HttpRetryOptions](/docs/reference/python-sdk/roboto/http/options#roboto.http.options.HttpRetryOptions) (class): Retry settings of an [`HttpClient`](/docs/reference/python-sdk/roboto/http/http_client#roboto.http.http_client.HttpClient): which failed requests it retries and how many times.

- [InvalidPaginationTokenError](/docs/reference/python-sdk/roboto/http/response#roboto.http.response.InvalidPaginationTokenError) (exception): The pagination token does not parse.

- [ORG_OVERRIDE_HEADER](/docs/reference/python-sdk/roboto/http/constants#roboto.http.constants.ORG_OVERRIDE_HEADER) (data): `ORG_OVERRIDE_HEADER = 'X-Roboto-Org-Id'`. Header naming the organization a request acts in.

- [ORG_OVERRIDE_QUERY_PARAM](/docs/reference/python-sdk/roboto/http/constants#roboto.http.constants.ORG_OVERRIDE_QUERY_PARAM) (data): `ORG_OVERRIDE_QUERY_PARAM = 'robotoOrgId'`. Query parameter that does the same as `ORG_OVERRIDE_HEADER`, read when the header is absent.

- [PaginatedList](/docs/reference/python-sdk/roboto/http/response#roboto.http.response.PaginatedList) (class): One page of a listing: the items on it, and a token that fetches the next page if there is one.

- [PaginationToken](/docs/reference/python-sdk/roboto/http/response#roboto.http.response.PaginationToken) (class): Pagination token whose contents callers treat as opaque, with a version that lets its format change.

- [PaginationTokenEncoding](/docs/reference/python-sdk/roboto/http/response#roboto.http.response.PaginationTokenEncoding) (class): Encoding of the data a `PaginationToken` carries.

- [PaginationTokenScheme](/docs/reference/python-sdk/roboto/http/response#roboto.http.response.PaginationTokenScheme) (class): Version of the `PaginationToken` format.

- [RESOURCE_OWNER_OVERRIDE_HEADER](/docs/reference/python-sdk/roboto/http/constants#roboto.http.constants.RESOURCE_OWNER_OVERRIDE_HEADER) (data): `RESOURCE_OWNER_OVERRIDE_HEADER = 'X-Roboto-Resource-Owner-Id'`. Header naming the organization that owns the resource a request reads or changes.

- [RESOURCE_OWNER_OVERRIDE_QUERY_PARAM](/docs/reference/python-sdk/roboto/http/constants#roboto.http.constants.RESOURCE_OWNER_OVERRIDE_QUERY_PARAM) (data): `RESOURCE_OWNER_OVERRIDE_QUERY_PARAM = 'robotoResourceOwnerId'`. Query parameter that does the same as `RESOURCE_OWNER_OVERRIDE_HEADER`, read when the header is absent.

- [ROBOTO_REQUESTER_HEADER](/docs/reference/python-sdk/roboto/http/requester#roboto.http.requester.ROBOTO_REQUESTER_HEADER) (data): `ROBOTO_REQUESTER_HEADER = 'X-Roboto-Requester'`. Header naming the program that sends the request, as a `RobotoRequester` in JSON.

- [RetryPredicate](/docs/reference/python-sdk/roboto/http/options#roboto.http.options.RetryPredicate) (data): Function that decides whether to retry a failed request, and returns `True` to retry it.

- [RobotoClient](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient) (class): Client that sends requests to one Roboto API endpoint with one set of credentials.

- [RobotoRequester](/docs/reference/python-sdk/roboto/http/requester#roboto.http.requester.RobotoRequester) (class): Description of the program sending a request to Roboto: the tool, its version, and the operating system.

- [RobotoTool](/docs/reference/python-sdk/roboto/http/requester#roboto.http.requester.RobotoTool) (class): Roboto tool a request is sent from, as recorded in `RobotoRequester.roboto_tool`.

- [ServerError](/docs/reference/python-sdk/roboto/exceptions/http#roboto.exceptions.http.ServerError) (exception): The server failed to handle the request and responded with a status of 500 or above.

- [SigV4AuthDecorator](/docs/reference/python-sdk/roboto/http/request_decorators#roboto.http.request_decorators.SigV4AuthDecorator) (class): Request decorator that signs each request with AWS Signature Version 4.

- [StreamedList](/docs/reference/python-sdk/roboto/http/response#roboto.http.response.StreamedList) (class): One read from a stream that may still be growing, such as the logs of an invocation that is running.

- [USER_OVERRIDE_HEADER](/docs/reference/python-sdk/roboto/http/constants#roboto.http.constants.USER_OVERRIDE_HEADER) (data): `USER_OVERRIDE_HEADER = 'X-Roboto-User-Id'`. Header naming the user a request acts on behalf of, by user ID, which for a person is their email address.

- [USER_OVERRIDE_QUERY_PARAM](/docs/reference/python-sdk/roboto/http/constants#roboto.http.constants.USER_OVERRIDE_QUERY_PARAM) (data): `USER_OVERRIDE_QUERY_PARAM = 'robotoUserId'`. Query parameter that does the same as `USER_OVERRIDE_HEADER`, read when the header is absent.

- [is_expected_to_be_transient()](/docs/reference/python-sdk/roboto/http/http_client#roboto.http.http_client.is_expected_to_be_transient) (function): Return whether a failed attempt at a request is expected to succeed if tried again.

- [never_retry()](/docs/reference/python-sdk/roboto/http/options#roboto.http.options.never_retry) (function): Return `False` to decline every retry, so the client attempts each request once.

- [roboto_headers()](/docs/reference/python-sdk/roboto/http/headers#roboto.http.headers.roboto_headers) (function): Build the headers that tell Roboto which API version, organization and user a request is for.
