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.
Currently, body data to be attached to a request via the
httpBodyproperty is either encoded as JSON in the case ofAPIotaCodableEndpointor encoded as URL-encoded form data in the case ofAPIotaURLEncodedFormEndpoint.Instead, it would probably be better if two parameter encoders existed for both use cases, which factor out the body data encoding from the
APIotaCodableEndpointprotocol and remove the need for theAPIotaURLEncodedFormEndpointprotocol 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-Typeheader 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.