---
title: transport
sidebarTitle: transport
---

# `keycardai.oauth.http.transport`


Transport protocol interfaces for HTTP operations.

This module defines the protocol interfaces that all transport implementations
must follow. Operations call these methods exclusively.


## Classes

### `HTTPTransport` <sup><a href="https://github.com/keycardai/python-sdk/blob/main/src/keycardai/oauth/http/transport.py#L12" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>


Protocol for synchronous HTTP transport implementations.


**Methods:**

#### `request_raw` <sup><a href="https://github.com/keycardai/python-sdk/blob/main/src/keycardai/oauth/http/transport.py#L15" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
request_raw(self, req: HttpRequest) -> HttpResponse
```

Execute a raw HTTP request synchronously.

**Args:**
- `req`: The HTTP request to execute
- `timeout`: Optional timeout in seconds

**Returns:**
- The HTTP response

**Raises:**
- `NetworkError`: For network-level failures


### `AsyncHTTPTransport` <sup><a href="https://github.com/keycardai/python-sdk/blob/main/src/keycardai/oauth/http/transport.py#L31" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>


Protocol for asynchronous HTTP transport implementations.


**Methods:**

#### `request_raw` <sup><a href="https://github.com/keycardai/python-sdk/blob/main/src/keycardai/oauth/http/transport.py#L34" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
request_raw(self, req: HttpRequest) -> HttpResponse
```

Execute a raw HTTP request asynchronously.

**Args:**
- `req`: The HTTP request to execute
- `timeout`: Optional timeout in seconds

**Returns:**
- The HTTP response

**Raises:**
- `NetworkError`: For network-level failures

