Created
February 19, 2013 15:26
-
-
Save 0xced/4986844 to your computer and use it in GitHub Desktop.
-[NSHTTPURLResponse allHeaderFields] returns a case-insensitive dictionary.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
int main(int argc, char *argv[]) | |
{ | |
@autoreleasepool | |
{ | |
NSDictionary *headerFields = @{ @"ETag" : @"12345678" }; | |
NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:[NSURL URLWithString:@"http://www.example.com"] statusCode:200 HTTPVersion:@"HTTP/1.1" headerFields:headerFields]; | |
NSLog(@"1. eTaG: %@", [[response allHeaderFields] objectForKey:@"eTaG"]); | |
NSLog(@"2. eTaG: %@", [headerFields objectForKey:@"eTaG"]); | |
} | |
} |
Author
0xced
commented
Feb 19, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment