iOS 带cookie进行网络请求
开发评易做图能时,需要在cookie中带有token才能发送,网络请求中添加token的方法如下:
NSDictionary *properties = [NSDictionary dictionaryWithObjectsAndKeys:
@"token",NSHTTPCookieValue, // token值
@"sso_tk", NSHTTPCookieName, // token名
@"/", NSHTTPCookiePath, // 路径
@"域名" ,NSHTTPCookieDomain, // 域
nil];
NSHTTPCookie *cookie_PD1 = [NSHTTPCookie cookieWithProperties:properties];
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookie:cookie_PD1];
补充:移动开发 , IOS ,