public final class URLEncodedFormEncoder

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

There is no published specification for how to encode collection types. By default, the convention of appending [] to the key for array values (foo[]=1&foo[]=2), and appending the key surrounded by square brackets for nested dictionary values (foo[bar]=baz) is used. Optionally, ArrayEncoding can be used to omit the square brackets appended to array keys.

BoolEncoding can be used to configure how Bool values are encoded. The default behavior is to encode true as 1 and false as 0.

DateEncoding can be used to configure how Date values are encoded. By default, the .deferredToDate strategy is used, which formats dates from their structure.

SpaceEncoding can be used to configure how spaces are encoded. Modern encodings use percent replacement (%20), while older encodings may expect spaces to be replaced with +.

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