Skip to content

FormEncoder

[Source]

Encode key-value pairs as application/x-www-form-urlencoded body data.

Uses WHATWG form encoding: spaces become +, unreserved characters (A-Z a-z 0-9 * - . _) pass through, everything else is %XX.

Returns Array[U8] val because the output is used as a request body, matching HTTPRequest.body's type. Use QueryParams instead when building URL query strings (which use RFC 3986 encoding and return String).

primitive val FormEncoder

Constructors

create

[Source]

new val create()
: FormEncoder val^

Returns


Public Functions

apply

[Source]

Encode params as form-urlencoded body data.

Keys and values are encoded per WHATWG spec. Pairs are joined with &. Returns an empty array if params is empty.

fun box apply(
  params: Array[(String val , String val)] val)
: Array[U8 val] val

Parameters

Returns


eq

[Source]

fun box eq(
  that: FormEncoder val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: FormEncoder val)
: Bool val

Parameters

Returns