Create a cookie for NSURLRequest?

后端 未结 5 1644
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-22 22:05

I\'m trying to send an authentication string via cookie in a NSMutableURLRequest. I\'m trying to create the NSHTTPCookie through

 +(id)cookieWithProperties:(         


        
5条回答
  •  旧时难觅i
    2020-12-22 22:51

    I could not get that to work.

    I got this to work however:

    NSMutableURLRequest* ret = [NSMutableURLRequest requestWithURL:myURL];
    [ret setValue:@"myCookie=foobar" forHTTPHeaderField:@"Cookie"];

提交回复
热议问题