Entering username and password to request Alamofire
I'm trying to use Alamofire to make a GET request for my iOS app, but I really don't know how to enter my username and password.
The cURL command ran successfully:
curl -k -u user: pw https: // url / cli / method
and it returned correct JSON
for Alamofire I tried
Alamofire.request(.GET, self.baseURL + method, parameters: params).responseJSON { (_, _, JSON, _) in
println(JSON)
where method baseURL + https: // url / rest / method
and params
let params = [
"username" : self.username.text,
"password" : self.password.text
]
but when i try it says that
NSURLConnection / CFURLConnection HTTP Load Error (kCFStreamErrorDomainSSL, -9813)
What am I doing wrong?
+3
source to share
2 answers