Skip to content

Customizable request parameter encoding strategies #12

@danielrbrowne

Description

@danielrbrowne

Currently, body data to be attached to a request via the httpBody property is either encoded as JSON in the case of APIotaCodableEndpoint or encoded as URL-encoded form data in the case of APIotaURLEncodedFormEndpoint.

Instead, it would probably be better if two parameter encoders existed for both use cases, which factor out the body data encoding from the APIotaCodableEndpoint protocol and remove the need for the APIotaURLEncodedFormEndpoint protocol altogether. In the case of URL-encoded form data, the destination for that data should be configurable (i.e. HTTP method dependent, explicitly appended to the request query string, or explicitly sets request body).

The Content-Type header of the request after having parameters encoded to it should be set automatically to the appropriate value (related Issue: #11 ).

Encoding multipart form data (see: #13) should also form part of this solution.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions