# sema-url 0.1.0 — API reference

Source declarations extracted without executing package code. Signatures describe declarations, not inferred runtime behavior.

## url/absolute?

```sema
(url/absolute? url)
```

Return #t when url is absolute, i.e. starts with a scheme followed by ://.

[Source line 188](https://pkg.sema-lang.com/packages/sema-url/0.1.0/source/package.sema#L188)

## url/build

```sema
(url/build parts)
```

Build a URL string from a parts map ({:scheme :userinfo :host :port :path :query :fragment}). nil parts are omitted; :query and :fragment are emitted verbatim (already-encoded).

[Source line 169](https://pkg.sema-lang.com/packages/sema-url/0.1.0/source/package.sema#L169)

## url/decode

```sema
(url/decode s)
```

Percent-decode a URL-encoded string. %XX sequences are decoded as UTF-8 bytes, + becomes a space, and a % not followed by two hex digits is kept literally.

[Source line 72](https://pkg.sema-lang.com/packages/sema-url/0.1.0/source/package.sema#L72)

## url/encode

```sema
(url/encode s)
```

Percent-encode a string for use in a URL component. Everything outside RFC 3986 unreserved characters is encoded; non-ASCII characters are encoded as their UTF-8 bytes (e.g. "é" → "%C3%A9").

[Source line 62](https://pkg.sema-lang.com/packages/sema-url/0.1.0/source/package.sema#L62)

## url/join

```sema
(url/join base ref)
```

Resolve ref against base, RFC 3986 style. An absolute ref replaces base; an absolute path replaces base's path; a relative path resolves against the directory of base's path (with ./.. normalization). Base's query and fragment are dropped; ref's are kept.

[Source line 197](https://pkg.sema-lang.com/packages/sema-url/0.1.0/source/package.sema#L197)

## url/parse

```sema
(url/parse url)
```

Parse a URL into {:scheme :userinfo :host :port :path :query :fragment}. Absent parts are nil; path defaults to "/". :port is an integer — a non-numeric port raises an error. IPv6 host literals are not supported.

[Source line 126](https://pkg.sema-lang.com/packages/sema-url/0.1.0/source/package.sema#L126)

## url/query-build

```sema
(url/query-build m)
```

Build a query string from a map, percent-encoding keys and values. Keys are emitted in sorted order; non-string values go through str.

[Source line 114](https://pkg.sema-lang.com/packages/sema-url/0.1.0/source/package.sema#L114)

## url/query-parse

```sema
(url/query-parse qs)
```

Parse a query string like "a=1&amp;b=2" into a map of decoded strings. nil or "" gives {}. A key without = gets value ""; when a key repeats, the last value wins.

[Source line 98](https://pkg.sema-lang.com/packages/sema-url/0.1.0/source/package.sema#L98)

## url/with-query

```sema
(url/with-query url params)
```

Return url with its query string replaced by the encoded params map. An empty map removes the query; the fragment is preserved.

[Source line 192](https://pkg.sema-lang.com/packages/sema-url/0.1.0/source/package.sema#L192)

---

Parser: sema-reader 1.37.0

Archive SHA-256: `0103c8ed137cc8dcc97affe2e1ebc3390c575edc280f0c664d87b28d3d6e85a8`
