I have an iOS app where I use NSURLConnection
to fetch some data. When I print the headers from the response, this is what I see:
"Content-Disposition" = "attachment;filename=test.txt.gz";
"Content-Encoding" = agzip;
"Content-Type" = "application/a-gzip";
Date = "Mon, 05 Nov 2012 22:18:23 GMT";
Server = "Apache-Coyote/1.1";
"Set-Cookie" = "JSESSIONID=3EBBF519202E16BEB1E79D12XXXXXXXXX; Path=/";
"Transfer-Encoding" = Identity;
filename = "test.txt.gz";
But, when I try to read the log the text file like this:
NSString *result = [[NSString alloc] initWithData:myData encoding:NSUTF8StringEncoding];
NSLog(@"%@",result);
I get null
. I know the data is there because it spits out hex when I log it, and I know the call works because I have tested it in RESTClient. Any thoughts?