URLEncode

[Source]

Functions for checking, encoding, and decoding parts of URLs.

primitive val URLEncode

Constructors

create

[Source]

new val create()
: URLEncode val^

Returns


Public Functions

encode

[Source]

URL encode and normilase the given string. The percent_encoded parameter indicates how '%' characters should be interpretted. true => given string is already at least partially encoded, so '%'s indicate an encoded character. false => given string is not yet encoded at all, so '%'s are just '%'s. An error is raised on invalid existing encoding or illegal characters that cannot be encoded.

fun box encode(
  from: String val,
  part: (URLPartUser val | URLPartPassword val | URLPartHost val | 
    URLPartPath val | URLPartQuery val | URLPartFragment val),
  percent_encoded: Bool val = true)
: String val ?

Parameters

Returns


decode

[Source]

URL decode a string. Raise an error on invalid URL encoded.

fun box decode(
  from: String val)
: String val ?

Parameters

Returns


check_scheme

[Source]

Check that the given string is a valid scheme.

fun box check_scheme(
  scheme: String val)
: Bool val

Parameters

Returns


check

[Source]

Check that the given string is valid to be the given URL part without further encoding. Canonical form is not checked for, merely validity.

fun box check(
  from: String val,
  part: (URLPartUser val | URLPartPassword val | URLPartHost val | 
    URLPartPath val | URLPartQuery val | URLPartFragment val))
: Bool val

Parameters

Returns


eq

[Source]

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

Parameters

Returns


ne

[Source]

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

Parameters

Returns