You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Is is possible with your library to actually get cookies from a response? See here for an example of the problem I'm trying to solve. Alamofire/Alamofire#946
Thanks
class CookieInterceptor: NSObject, ResponseInterceptor {
func process<ReturnType>(endpoint: Endpoint<ReturnType>, response: NSHTTPURLResponse?, responseObject: ResponseObject) -> ProcessResults {
print(response)
for cookie in NSHTTPCookieStorage.sharedHTTPCookieStorage().cookiesForURL(response!.URL!)! {
print(cookie)
}
return ProcessResults(true, nil)
}
}
An interceptor like this should print the cookies, you would need to be pointing your build against the dev branch however. You also need to make sure to set your acceptsCookies param on your endpoint to true
This is tested against https://httpbin.org/cookies/set?k2=v2&k1=v1
Activity
jzdhuang commentedon May 17, 2016
An interceptor like this should print the cookies, you would need to be pointing your build against the dev branch however. You also need to make sure to set your
acceptsCookiesparam on your endpoint to trueThis is tested against
https://httpbin.org/cookies/set?k2=v2&k1=v1