Skip to main content

ClikaRT::http::HttpResponse

struct

Header: ClikaRT/http/types.h

A finished HTTP response, the OUTCOME of a request the server answered. Any answered status is an outcome, not an error: a 404 or 401 arrives here as data, and you branch on status (or ok()). Only a request that could not complete at all (connection, TLS, timeout, cancellation) is an error on the Result channel. For a fetch that streamed its body elsewhere (fetch_file), body is empty; status / reason / headers still apply.

Member functions

ok()

bool ok() const noexcept

True for a 2xx status.

Declared in ClikaRT/http/types.h, line 66

Data members

status

int status = 0

e.g. 200, 404

Declared in ClikaRT/http/types.h, line 60

reason

std::string reason

e.g. "OK", "Not Found"

Declared in ClikaRT/http/types.h, line 61

headers

Headers headers

response headers (case-insensitive bag)

Declared in ClikaRT/http/types.h, line 62

body

std::string body

response bytes (empty when streamed elsewhere)

Declared in ClikaRT/http/types.h, line 63