> 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.types

Dependency-free request and response values for outbound HTTP calls.

## Module Contents

### Classes

| Name                                                        | Description                                                           |
| ----------------------------------------------------------- | --------------------------------------------------------------------- |
| [`HTTPRequest`](#nemoguardrails-http-types-HTTPRequest)     | Describe an outbound HTTP request without transport-specific objects. |
| [`HTTPResponse`](#nemoguardrails-http-types-HTTPResponse)   | A materialized, transport-neutral HTTP response.                      |
| [`HTTPTLSConfig`](#nemoguardrails-http-types-HTTPTLSConfig) | Configure TLS verification and optional mutual authentication.        |

### API

```python
class nemoguardrails.http.types.HTTPRequest(
    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
)
```

Dataclass

Describe an outbound HTTP request without transport-specific objects.

The value is suitable for status-error context and deterministic test
assertions. It does not perform a request itself.

**`content`** `bytes | str | None = None`

---

**`headers`** `Mapping[str, str] | None = None`

---

**`method`** `str`

---

**`params`** `Mapping[str, Any] | None = None`

---

**`timeout`** `float | None = None`

---

**`url`** `str`

---

```python
class nemoguardrails.http.types.HTTPResponse(
    status_code: int,
    headers: typing.Mapping[str, str] = dict(),
    content: bytes = b'',
    extensions: typing.Mapping[str, typing.Any] = dict()
)
```

Dataclass

A materialized, transport-neutral HTTP response.

`content` owns the response bytes, so callers can decode the body after
the transport or client context has closed. `extensions` carries optional
non-portable metadata without changing the core contract.

**`content`** `bytes = b''`

---

**`extensions`** `Mapping[str, Any] = field(default_factory=dict)`

---

**`headers`** `Mapping[str, str] = field(default_factory=dict)`

---

**`is_success`** `bool`

Return whether the status code is in the 2xx range.

---

**`status_code`** `int`

---

**`text`** `str`

Decode the response body using its declared charset or UTF-8.

---

```python
nemoguardrails.http.types.HTTPResponse.json() -> typing.Any
```

Decode the response body as JSON.

**Raises:**

* `HTTPResponseDecodeError`: If the body is not valid JSON.

```python
nemoguardrails.http.types.HTTPResponse.raise_for_status(
    request: nemoguardrails.http.types.HTTPRequest | None = None
) -> None
```

Raise :class:`HTTPStatusError` for status codes of 400 or greater.

```python
class nemoguardrails.http.types.HTTPTLSConfig(
    verify: bool = True,
    ca_bundle: str | None = None,
    client_certificate: str | None = None,
    client_key: str | None = None
)
```

Dataclass

Configure TLS verification and optional mutual authentication.

A custom CA bundle applies only when verification is enabled. Client
certificate and key paths must be supplied together.

**`ca_bundle`** `str | None = None`

---

**`client_certificate`** `str | None = None`

---

**`client_key`** `str | None = None`

---

**`verify`** `bool = True`

---

```python
nemoguardrails.http.types.HTTPTLSConfig.__post_init__() -> None
```