---
title: "Request"
sidebar_label: "Request"
description: "The clika_runtime.http Request class."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

The request a handler is answering. Valid during the handler call only: a read after the call raises RuntimeError.

## `body` (property)

The raw request bytes.

## `client_ip` (property)

The peer's socket address.

## `method` (property)

The HTTP verb ('GET', 'POST', ...).

## `param_count` (property)

The number of path captures on the matched route.

## `path` (property)

The decoded path, without the query string.

## `should_stop` (property)

True once the connection closed or the server is stopping; a long handler checks it to finish early.

## `__init__`

```python
__init__(self, /, *args, **kwargs)
```

Initialize self.  See help(type(self)) for accurate signature.

## `attr`

```python
attrattr(self, name: str) -> str | None
```

attr(self, name: str) -> str | None

attr(name) -> str | None

An attribute set by set_attr.

## `cookie`

```python
cookiecookie(self, name: str) -> str | None
```

cookie(self, name: str) -> str | None

cookie(name) -> str | None

A cookie from the Cookie header.

## `cookies`

```python
cookiescookies(self) -> dict
```

cookies(self) -> dict

cookies() -> dict[str, str]

Every cookie of the Cookie header, the first value winning for a repeated name; the reading cookie(name) answers by name.

## `form_field`

```python
form_fieldform_field(self, name: str) -> str | None
```

form_field(self, name: str) -> str | None

form_field(name) -> str | None

A text field of a form body (multipart or urlencoded).

## `form_file`

```python
form_fileform_file(self, name: str) -> clika_runtime._core.http.FormFile | None
```

form_file(self, name: str) -> clika_runtime._core.http.FormFile | None

form_file(name) -> FormFile | None

An uploaded file of a multipart body.

## `form_parts`

```python
form_partsform_parts(self) -> list[clika_runtime._core.http.FormPart]
```

form_parts(self) -> list[clika_runtime._core.http.FormPart]

form_parts() -> list[FormPart]

Every part of a multipart body, repeated names kept; empty when the body is not multipart.

## `header`

```python
headerheader(self, name: str) -> str | None
```

header(self, name: str) -> str | None

header(name) -> str | None

The first value of a header, matched without regard to case.

## `param`

```python
paramparam(self, key: object) -> str
```

param(self, key: object) -> str

param(key) -> str

A path capture of a pattern route, by 0-based position (int) or by the name of a named group (str). IndexError / KeyError when the route has no such capture.

## `query`

```python
queryquery(self, name: str) -> str | None
```

query(self, name: str) -> str | None

query(name) -> str | None

The first value of a query parameter.

## `query_all`

```python
query_allquery_all(self, name: str) -> list[str]
```

query_all(self, name: str) -> list[str]

query_all(name) -> list[str]

Every value of a query parameter.

## `set_attr`

```python
set_attrset_attr(self, name: str, value: str) -> None
```

set_attr(self, name: str, value: str) -> None

set_attr(name, value) -> None

Attach a per-request attribute, the channel from a middleware to the handler.
