无法满足\'Expect \“请求标头()中给出的期望

时间:2015-11-04 11:29:08

标签: swift2 ios9 xcode7 alamofire

这是我的代码块,我不断收到错误errorDomain = NSCocoaErrorDomain Code = 3840“字符0周围的值无效”当我尝试使用responseString而不是responseJSON时,我收到错误“期望\”请求标题()中的期望无法实现“

let parameter = ["mobileNumber":number]
let header = ["accessToken" : newToken,"Content-Type":"Application/JSON"]
let url1 = NSURL(string: baseUrl + registerMobileUrl)
Alamofire
.request(.POST, url1!, parameters: parameter, encoding: ParameterEncoding.JSON, headers : header)
.responseString { response in
print("All header fields are (response.response?.allHeaderFields)")
print("the response main of register mobile is (response)")

0 个答案:

没有答案