---
title: "std.host"
url: https://una-lang.org/en/docs/std/host/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/docs/std/listing.json
---

# std.host

The items of `std.host` for serving HTTP, one page each. A module imports them by name, as `import std.host (HttpServer, Request, Reply)`: unlike the host capabilities of [`spec/14 §3`](https://una-lang.org/en/docs/spec/14-standard-library/#s3), the prelude does not put them in scope ([`spec/31 §1`](https://una-lang.org/en/docs/spec/31-http-servers/1-the-capability/#s1)).

Operators, comparisons, equality and interpolation are built in and not listed here ([`spec/14 §2`](https://una-lang.org/en/docs/spec/14-standard-library/#s2)). The built-in methods, `.len` and those of maps and of fixed-width integers, are on [Built-in methods](https://una-lang.org/en/docs/std/builtin/).

## Types

- [`Method`](https://una-lang.org/en/docs/std/host/Method/): The methods a request may have (`spec/31 §1`, ADR 0123 rule 1). (0.4, 0.5 preview)
- [`Param`](https://una-lang.org/en/docs/std/host/Param/): One decoded query parameter of a request, as `name=value` (`spec/31 §4` rule 4). (0.4, 0.5 preview)
- [`Request`](https://una-lang.org/en/docs/std/host/Request/): A request, as the host read it (`spec/31 §3`, `§4`): its target in origin-form as received, its path split on `/` and percent-decoded segment by segment, the parameters of its query decoded in order, its headers with names in ASCII lower case in the order received, its whole body, the peer's IP address without its port, and the grant's address as the grant writes it. (0.4, 0.5 preview)
- [`Exchange`](https://una-lang.org/en/docs/std/host/Exchange/): A request and the reply right to answer it once (`spec/31 §1`, ADR 0123 rule 4). (0.4, 0.5 preview)
- [`Status`](https://una-lang.org/en/docs/std/host/Status/): The status of a reply: a `1xx` status is the host's alone (`spec/31 §5`). (0.4, 0.5 preview)
- [`Reply`](https://una-lang.org/en/docs/std/host/Reply/): A reply to a request (`spec/31 §5`): the host writes its framing headers itself. (0.4, 0.5 preview)
- [`ServeError`](https://una-lang.org/en/docs/std/host/ServeError/): Why an operation of `HttpServer` fails (`spec/31 §1`): `Interrupted` at a host stop, `TimedOut` when a deadline of the program cuts the wait of `next`, `Closed` after `close`, `NotHeld` for a reply right the task does not hold or answered already, and `BadReply` for a reply the host refuses to send. (0.4, 0.5 preview)

## Capabilities

- [`HttpServer`](https://una-lang.org/en/docs/std/host/HttpServer/): The server side of HTTP/1.1, on the addresses that `serve` grants allow (`spec/31 §1`, ADR 0123 rules 1 to 5). (0.4, 0.5 preview)

Generated from the standard modules of una v0.4.0 ([`docs/std/listing.json`](https://github.com/una-lang/una/blob/5fec93d88932b333feec25e589355a2cb34c37b5/docs/std/listing.json), which is not part of the specification). The specification governs: [`spec/14 §1`](https://una-lang.org/en/docs/spec/14-standard-library/#s1).
