瀏覽代碼

Update README.md

Mattt Thompson 11 年之前
父節點
當前提交
7ce248d3d9
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      README.md

+ 2 - 3
README.md

@@ -265,7 +265,7 @@ let user = "user"
 let password = "password"
 
 Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(user)/\(password)")
-    .authenticate(HTTPBasic: user, password: password)
+    .authenticate(user: user, password: password)
     .response {(request, response, _, error) in
         println(response)
     }
@@ -278,12 +278,11 @@ let user = "user"
 let password = "password"
 
 let credential = NSURLCredential(user: user, password: password, persistence: .ForSession)
-let protectionSpace = NSURLProtectionSpace(host: "httpbin.org", port: 0, `protocol`: "https", realm: nil, authenticationMethod: NSURLAuthenticationMethodHTTPBasic)
 ```
 
 ```swift
 Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(user)/\(password)")
-    .authenticate(usingCredential: credential, forProtectionSpace: protectionSpace)
+    .authenticate(usingCredential: credential)
     .response {(request, response, _, error) in
         println(response)
 }