ios url上加cooking

Posted ShineYangGod

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ios url上加cooking相关的知识,希望对你有一定的参考价值。

NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:[NSURL URLWithString:url]];
        for (NSHTTPCookie *cookie in cookies)
            
            // cookiesWithResponseHeaderFields方法,需要为URL设置一个cookie为NSDictionary类型的header,注意NSDictionary里面的forKey需要是@"Set-Cookie"
            NSArray *headeringCookie = [NSHTTPCookie cookiesWithResponseHeaderFields:
                                        [NSDictionary dictionaryWithObject:
                                         [[NSString alloc] initWithFormat:@"%@=%@",[cookie name],[cookie value]]
                                                                    forKey:@"Set-Cookie"]
                                                                              forURL:urlString];
            
            // 通过setCookies方法,完成设置,这样只要一访问URL为HOST的网页时,会自动附带上设置好的header
            [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookies:headeringCookie
                                                               forURL:[NSURL URLWithString:url]
                                                      mainDocumentURL:nil];
       
        

以上是关于ios url上加cooking的主要内容,如果未能解决你的问题,请参考以下文章

iOS图片上加标签或者水印

sqlmap命令

cookie session URL重写 与考试

Cook-Torrance光照模型

cook的特性

Cook-Torrance光照模型