> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/guardrails/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/guardrails/_mcp/server.

# nemoguardrails.http.client

Protocols implemented by transport-neutral asynchronous HTTP clients.

## Module Contents

### Classes

| Name                                                                   | Description                                                                |
| ---------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| [`ClosableHTTPClient`](#nemoguardrails-http-client-ClosableHTTPClient) | An HTTP client that exposes asynchronous resource cleanup.                 |
| [`HTTPClient`](#nemoguardrails-http-client-HTTPClient)                 | Send asynchronous HTTP requests without exposing transport-specific types. |

### API

```python
class nemoguardrails.http.client.ClosableHTTPClient()
```

Protocol

**Bases:** [HTTPClient](#nemoguardrails-http-client-HTTPClient)

An HTTP client that exposes asynchronous resource cleanup.

```python
nemoguardrails.http.client.ClosableHTTPClient.close() -> None
```

async

Release resources owned by the client.

Implementations must make repeated calls safe.

```python
class nemoguardrails.http.client.HTTPClient()
```

Protocol

Send asynchronous HTTP requests without exposing transport-specific types.

```python
nemoguardrails.http.client.HTTPClient.request(
    method: str,
    url: str,
    headers: typing.Mapping[str, str] | None = None,
    params: typing.Mapping[str, typing.Any] | None = None,
    json: typing.Any = None,
    content: bytes | str | None = None,
    timeout: float | None = None
) -> nemoguardrails.http.types.HTTPResponse
```

async

Send one request and return a response whose content is fully owned.

**Parameters:**

**`method`** `str`

HTTP method, case-insensitive.

---

**`url`** `str`

Absolute request URL.

---

**`headers`** `Mapping[str, str] | None` — default: None

Optional request headers.

---

**`params`** `Mapping[str, Any] | None` — default: None

Optional query parameters.

---

**`json`** `Any` — default: None

Optional JSON-serializable request body.

---

**`content`** `bytes | str | None` — default: None

Optional raw request body.

---

**`timeout`** `float | None` — default: None

Optional total request timeout in seconds.

---

**Returns:** `HTTPResponse`

A transport-neutral response containing materialized body bytes.