URLEncodedFormEncoder

public final class URLEncodedFormEncoder

An object that encodes instances into URL-encoded query strings.

ArrayEncoding can be used to configure how Array values are encoded. By default, the .brackets encoding is used, encoding array values with brackets for each value. e.g array[]=1&array[]=2.

BoolEncoding can be used to configure how Bool values are encoded. By default, the .numeric encoding is used, encoding true as 1 and false as 0.

DataEncoding can be used to configure how Data values are encoded. By default, the .deferredToData encoding is used, which encodes Data values using their default Encodable implementation.

DateEncoding can be used to configure how Date values are encoded. By default, the .deferredToDate encoding is used, which encodes Dates using their default Encodable implementation.

KeyEncoding can be used to configure how keys are encoded. By default, the .useDefaultKeys encoding is used, which encodes the keys directly from the Encodable implementation.

KeyPathEncoding can be used to configure how paths within nested objects are encoded. By default, the .brackets encoding is used, which encodes each sub-key in brackets. e.g. parent[child][grandchild]=value.

NilEncoding can be used to configure how nil Optional values are encoded. By default, the .dropKey encoding is used, which drops nil key / value pairs from the output entirely.

SpaceEncoding can be used to configure how spaces are encoded. By default, the .percentEscaped encoding is used, replacing spaces with %20.

This type is largely based on Vapor’s url-encoded-form project.