小编das*_*ble的帖子

Swift 2.0,Alamofire:在HTTP Post Request中设置cookie

我想在我的HTTP POST请求中设置cookie.

类似于下面的HTTP请求中的cookie字段,

version: 0.1.7
Cookie: client=Android; version=0.1.7; sellerId=SEL5483318784; key=178a0506-0639-4659-9495-67e5dffa42de
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 1431
Run Code Online (Sandbox Code Playgroud)

如何通过Alamofire实现这一目标?

我目前的Alamofire请求是这样的,

Alamofire.request(.POST, ServerConfig.ADD_PRODUCT_URL, parameters: productJSON, encoding: .JSON, headers: nil)
     .responseJSON(completionHandler: { responseRequest, responseResponse, responseResult in
         print(responseRequest!.URL)
         print(responseResponse)
         print(responseResult)
     })
Run Code Online (Sandbox Code Playgroud)

cookies nsurlrequest swift alamofire swift2

10
推荐指数
1
解决办法
9117
查看次数

'InvalidOperationException',原因:在LSApplicationQueriesSchemes下的Info.plist中缺少'fbauth2,iOS 9.0需要'

在您将此标记为重复之前,请注意我已在相关问题中尝试了所有解决方案.当我点击我的应用程序上的Facebook登录按钮时,应用程序崩溃时出现此错误

2015-10-28 18:31:05.277 retailcatalogue[96362:2057887] *** Terminating app due to uncaught exception 'InvalidOperationException', reason: 'fbauth2 is missing from your Info.plist under LSApplicationQueriesSchemes and is required for iOS 9.0'
Run Code Online (Sandbox Code Playgroud)

我查看了可用的解决方案并更新了我的info.plist但它仍然无效.请帮忙,谢谢!

我的info.plist

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fbapi</string>
    <string>fbapi20130214</string>
    <string>fbapi20130410</string>
    <string>fbapi20130702</string>
    <string>fbapi20131010</string>
    <string>fbapi20131219</string>
    <string>fbapi20140410</string>
    <string>fbapi20140116</string>
    <string>fbapi20150313</string>
    <string>fbapi20150629</string>
    <string>fbauth</string>
    <string>fbauth2 </string>
    <string>fb-messenger-api20140430</string>
    <string>fb-messenger-platform-20150128</string>
    <string>fb-messenger-platform-20150218</string>
    <string>fb-messenger-platform-20150305</string>
</array>
Run Code Online (Sandbox Code Playgroud)

facebook facebook-sdk-3.1 facebook-sdk-4.0 ios9 swift2

3
推荐指数
2
解决办法
6070
查看次数