|
|
@@ -47,17 +47,17 @@ public enum Method: String {
|
|
|
*/
|
|
|
public enum ParameterEncoding {
|
|
|
/**
|
|
|
- A query string to be set as or appended to any existing URL query for `GET`, `HEAD`, and `DELETE` requests, or set as the body for requests with any other HTTP method. Since there is no published specification for how to encode collection types, 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`).
|
|
|
+ A query string to be set as or appended to any existing URL query for `GET`, `HEAD`, and `DELETE` requests, or set as the body for requests with any other HTTP method. The `Content-Type` HTTP header field of an encoded request with HTTP body is set to `application/x-www-form-urlencoded`. Since there is no published specification for how to encode collection types, 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`).
|
|
|
*/
|
|
|
case URL
|
|
|
|
|
|
/**
|
|
|
- Uses `NSJSONSerialization` to create a JSON representation of the parameters object, which is set as the body of the request.
|
|
|
+ Uses `NSJSONSerialization` to create a JSON representation of the parameters object, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`.
|
|
|
*/
|
|
|
case JSON
|
|
|
|
|
|
/**
|
|
|
- Uses `NSPropertyListSerialization` to create a plist representation of the parameters object, according to the associated format and write options values, which is set as the body of the request.
|
|
|
+ Uses `NSPropertyListSerialization` to create a plist representation of the parameters object, according to the associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/x-plist`.
|
|
|
*/
|
|
|
case PropertyList(NSPropertyListFormat, NSPropertyListWriteOptions)
|
|
|
|