Swift: How to remember cookies for further http requests

后端 未结 3 926
忘了有多久
忘了有多久 2020-12-13 14:27

I am working on a login application. After successful login response comes back with cookie data.
How can I use/save this data for my future requests?
For starters

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-13 14:57

    class func cookiesWithResponseHeaderFields(_ headerFields: [String : String], forURL URL: NSURL) -> [NSHTTPCookie]

    Note that headerFields is [String: String] Dictionary and the compiler is complaining that you're passing [NSObject : AnyObject]

提交回复
热议问题