大佬教程收集整理的这篇文章主要介绍了xcode – Alamorafire SwiftyJson FacebookSDK,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我发布帖子请求的代码:
let headers = [ "Content-Type": "application/json" ] let userProfile = userProfile as? [String : AnyObject] Alamofire.request(.POST,"http://localhost:8888/api/profile",parameters: userProfile,headers: headers,encoding:ParameterEncoding.URL) .response { request,response,data,error in print(userProfilE) //This prints nil print(responsE) //This prints api error for expecTing data }
不幸的是我收到此错误:
如果我尝试将JSON数据直接发送到API,我会收到此错误:
任何帮助表示赞赏.我只是想知道,如何将JSON对象转换为String AnyObject?没有失败.或者使用Swift 2将Json对象作为post / put / patch请求数据发送.
以上是大佬教程为你收集整理的xcode – Alamorafire SwiftyJson FacebookSDK全部内容,希望文章能够帮你解决xcode – Alamorafire SwiftyJson FacebookSDK所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。