/http
Shared HTTP method, status code, content-type, and request/response inspection predicates.
Functions & symbols#
content-type-of#
Returns the `Content-Type` header value of an HTTP message.
| Parameter | Type | Optional | Description |
|---|---|---|---|
msg | Map | required | HTTP request or response Map |
default | Any | optional | Optional default value |
Any(server/content-type-of req)form-of#
Parses an `application/x-www-form-urlencoded` or `multipart/form-data` body into a field Map.
| Parameter | Type | Optional | Description |
|---|---|---|---|
req | Map | required | Incoming HTTP request Map |
Any(let fields (server/form-of req))get-header#
Performs a case-insensitive lookup of HTTP header `name`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
msg | Map | required | HTTP request or response Map |
name | String | KeySymbol | required | Case-insensitive header name |
default | Any | optional | Optional default value |
Any(server/header-of req "authorization")header-of#
Re-export case-insensitive header and URI lookup helpers
| Parameter | Type | Optional | Description |
|---|---|---|---|
msg | Map | required | HTTP request or response Map |
name | String | KeySymbol | required | Case-insensitive header name |
default | Any | optional | Optional default value |
Any(server/header-of req "authorization")is-delete?#
Returns `true` when the request method is `"DELETE"`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
req | Any | required | — |
Anyis-get?#
Request method and content inspectors Returns `true` when the request method is `"GET"`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
req | Any | required | — |
Anyis-head?#
Returns `true` when the request method is `"HEAD"`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
req | Any | required | — |
Anyis-json-request?#
Returns `true` if `Accept` prefers JSON or `Content-Type` starts with `application/json`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
req | Any | required | — |
Anyis-options?#
Returns `true` when the request method is `"OPTIONS"`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
req | Any | required | — |
Anyis-patch?#
Returns `true` when the request method is `"PATCH"`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
req | Any | required | — |
Anyis-post?#
Returns `true` when the request method is `"POST"`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
req | Any | required | — |
Anyis-put?#
Returns `true` when the request method is `"PUT"`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
req | Any | required | — |
Anyjson-of#
Decodes the JSON body of an HTTP request or response Map into native Tangu data.
| Parameter | Type | Optional | Description |
|---|---|---|---|
req | Map | required | Incoming HTTP request Map |
Any(let body (server/json-of req))path-of#
Extracts the decoded URI path segment from an incoming request Map.
| Parameter | Type | Optional | Description |
|---|---|---|---|
req | Map | required | Incoming HTTP request Map |
Any(let path (server/path-of req))query-of#
Parses URL query parameters into a Map (promoting repeated keys into Arrays).
| Parameter | Type | Optional | Description |
|---|---|---|---|
req | Map | required | Incoming HTTP request Map |
Any(let q (server/query-of req))query-string-of#
Returns the raw URL query string (excluding `?`) from a request Map.
| Parameter | Type | Optional | Description |
|---|---|---|---|
req | Map | required | Incoming HTTP request Map |
Any(let qs (server/query-string-of req))request#
Request / Response constructors Constructs a typed `#http/Request` map with `method`, `url`, optional `headers`, and optional `body`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
method | Any | required | — |
url | Any | required | — |
headers | Any | required | — |
body | Any | required | — |
Anyresponse#
Constructs a typed `#http/Response` map with HTTP `status`, optional `headers`, and optional `body`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
status | Any | required | — |
headers | Any | required | — |
body | Any | required | — |
Any