abla/http/json
Generated from source.
Import with import "abla/http/json".
Source: abla/http/json/entry.ab
httpJsonLimits (fun)
fun httpJsonLimits(): JsonLimits
Returns the default request-body JSON limits, including a 1 MiB input cap and duplicate-key rejection.
HttpRequest.parseJson (extension fun)
fun HttpRequest.parseJson(
limits: JsonLimits = httpJsonLimits()
): JsonParseResult
Parses the body using limits when Content-Type is application/json or a media type ending in +json. Returns unsupported_media_type for a missing or unsupported Content-Type, or the JSON parser's result.
httpJsonValue (fun)
fun httpJsonValue(
value: Json,
status: int = 200,
headers: array<HttpHeader> = []
): HttpResponse
Serializes value into a response with status and headers, replacing Content-Type with application/json and UTF-8 charset.
httpPostJson (fun)
fun httpPostJson(
path: string,
value: Json,
headers: array<HttpHeader> = []
): HttpRequest
Constructs a POST to path with serialized value as the body. Replaces Content-Type in headers with JSON and supplies Accept: application/json when absent.
Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.