Kaynağa Gözat

Updated the migration guide with the parameter encoding updates.

Christian Noon 10 yıl önce
ebeveyn
işleme
bd33eee6cf

+ 6 - 0
Documentation/Alamofire 2.0 Migration Guide.md

@@ -148,8 +148,14 @@ Encoding `MultipartFormData` previous returned an `EncodingResult` to encapsulat
 
 ### Parameter Encoding
 
+#### ACL Updates
+
 The `ParameterEncoding` enumeration implementation was previously hidden behind `internal` and `private` ACLs. Alamofire 2.0 opens up the `queryComponents` and `escape` methods to make it much easier to implement `.Custom` cases.
 
+#### Encoding in the URL
+
+In the previous versions of Alamofire, `.URL` encoding would automatically append the query string to either the URL or HTTP body depending on which HTTP method was set in the `NSURLRequest`. While this satisfies the majority of common use cases, it made it quite difficult to append query string parameter to a URL for HTTP methods such as `PUT` and `POST`. In Alamofire 2.0, we've added a second URL encoding case, `.URLEncodedInURL`, that always appends the query string to the URL regardless of HTTP method.
+
 ### Server Trust Policies
 
 In Alamofire 1.x, the `ServerTrustPolicyManager` methods were internal making it impossible to implement any custom domain matching behavior. Alamofire 2.0 opens up the internals with a `public` ACL allowing more flexible server trust policy matching behavior (i.e. wildcarded domains) through subclassing.