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: Wolfgang Lux
Subject: Re: How to set multiple headers with same name to GSMimeDocument
Date: Wed, 3 Jul 2013 19:20:57 +0200

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:.

Wolfgang




reply via email to

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