Browse Source

[PR #810] Updated basic auth example in the README to compile on Swift 2.0.

David F. Muir V 10 years ago
parent
commit
1392549743
1 changed files with 2 additions and 2 deletions
  1. 2 2
      README.md

+ 2 - 2
README.md

@@ -511,13 +511,13 @@ let user = "user"
 let password = "password"
 
 let credentialData = "\(user):\(password)".dataUsingEncoding(NSUTF8StringEncoding)!
-let base64Credentials = credentialData.base64EncodedStringWithOptions(nil)
+let base64Credentials = credentialData.base64EncodedStringWithOptions([])
 
 let headers = ["Authorization": "Basic \(base64Credentials)"]
 
 Alamofire.request(.GET, "http://httpbin.org/basic-auth/user/password", headers: headers)
          .responseJSON { response in
-             debugPrint(result)
+             debugPrint(response)
          }
 ```