discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to set multiple headers with same name to GSMimeDocument


From: Sebastian Reitenbach
Subject: Re: How to set multiple headers with same name to GSMimeDocument
Date: Wed, 03 Jul 2013 19:58:39 +0200
User-agent: SOGoMail 2.0.6a

 
On Wednesday, July 3, 2013 19:20 CEST, Wolfgang Lux <wolfgang.lux@gmail.com> 
wrote: 
 
> Sebastian Reitenbach wrote:
> 
> > Hi,
> > 
> > I'm use WebServer library. That uses GSMimeDocuments to send back a 
> > response to the client.
> > 
> > I want to set multiple cookies in the response so I do:
> > 
> >      for (id C in cookies)
> >        {
> >          [response setHeader:@"Set-Cookie"
> >                        value:[NSString stringWithFormat:@"%@=%@", [C 
> > objectAtIndex:0], [C objectAtIndex:1]]
> >                   parameters:[NSDictionary 
> > dictionaryWithObjectsAndKeys:@"/", @"path", nil]];
> >           NSLog(@"the response: %@", response);
> >        }
> > 
> > However, I recognized, when setting a header with same name, it will 
> > override prior occurrences,
> > as the NSLog tells me. Reconsulting the documentation, it seems to work as 
> > designed.
> > 
> > Is there another way to set multiple headers with the same name, 
> > specifically to allow me to set 
> > multiple cookies in the response?
> 
> Use -addHeader:value:parameters: instead of -setHeader:value:parameters:.

Doh! there are way too many trees in front of the wood!
I'm definitely missing the see also: sections like in the apple docs :(


thanks,
Sebastian

> 
> Wolfgang
> 
 
 
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]