<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to download and process GZip&#8217;d data</title>
	<atom:link href="http://iPhoneDeveloperTips.com/cocoa/how-to-download-and-process-gzipd-data.html/feed" rel="self" type="application/rss+xml" />
	<link>http://iPhoneDeveloperTips.com/cocoa/how-to-download-and-process-gzipd-data.html</link>
	<description>iOS Developer Tips, Tricks and Tutorials.</description>
	<lastBuildDate>Wed, 08 Feb 2012 06:31:16 -0600</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: VSVasan</title>
		<link>http://iPhoneDeveloperTips.com/cocoa/how-to-download-and-process-gzipd-data.html#comment-44188</link>
		<dc:creator>VSVasan</dc:creator>
		<pubDate>Sat, 19 Mar 2011 00:38:22 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=773#comment-44188</guid>
		<description>When the header &quot;Accept-Encoding&quot; is added, would the NSData received from NSURLConnection get decompressed automatically or do we need look at the header to see whaat the content encoding is and call the NSDataAddtions that someone wrote to decompress NSData in memory. I understand NSURLDownload supports gzip. 

Thanks for your help in advance</description>
		<content:encoded><![CDATA[<p>When the header &#8220;Accept-Encoding&#8221; is added, would the NSData received from NSURLConnection get decompressed automatically or do we need look at the header to see whaat the content encoding is and call the NSDataAddtions that someone wrote to decompress NSData in memory. I understand NSURLDownload supports gzip. </p>
<p>Thanks for your help in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Florian</title>
		<link>http://iPhoneDeveloperTips.com/cocoa/how-to-download-and-process-gzipd-data.html#comment-43847</link>
		<dc:creator>Florian</dc:creator>
		<pubDate>Tue, 15 Mar 2011 15:20:29 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=773#comment-43847</guid>
		<description>I think the header should state &quot;Accept-Encoding&quot;, not &quot;Accepts-Encoding&quot;.
See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
Also, I think you meant to write:

response.setHeader(&quot;Content-Encoding&quot;, &quot;gzip&quot;);

not

request.setHeader(&quot;Content-Encoding&quot;, &quot;gzip&quot;);

Regards,
   Florian</description>
		<content:encoded><![CDATA[<p>I think the header should state &#8220;Accept-Encoding&#8221;, not &#8220;Accepts-Encoding&#8221;.<br />
See <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html" rel="nofollow">http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html</a><br />
Also, I think you meant to write:</p>
<p>response.setHeader(&#8220;Content-Encoding&#8221;, &#8220;gzip&#8221;);</p>
<p>not</p>
<p>request.setHeader(&#8220;Content-Encoding&#8221;, &#8220;gzip&#8221;);</p>
<p>Regards,<br />
   Florian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Orlov</title>
		<link>http://iPhoneDeveloperTips.com/cocoa/how-to-download-and-process-gzipd-data.html#comment-1985</link>
		<dc:creator>Mike Orlov</dc:creator>
		<pubDate>Thu, 14 May 2009 10:55:28 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=773#comment-1985</guid>
		<description>Check this link: http://www.clintharris.net/2009/how-to-gzip-data-in-memory-using-objective-c/  

It contains absolutely clear and straight implementation for in-memory compressing NSData with gzip.</description>
		<content:encoded><![CDATA[<p>Check this link: <a href="http://www.clintharris.net/2009/how-to-gzip-data-in-memory-using-objective-c/" rel="nofollow">http://www.clintharris.net/2009/how-to-gzip-data-in-memory-using-objective-c/</a>  </p>
<p>It contains absolutely clear and straight implementation for in-memory compressing NSData with gzip.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pascal</title>
		<link>http://iPhoneDeveloperTips.com/cocoa/how-to-download-and-process-gzipd-data.html#comment-193</link>
		<dc:creator>Pascal</dc:creator>
		<pubDate>Wed, 28 Jan 2009 10:48:36 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=773#comment-193</guid>
		<description>Yes, are there any experiences with compressing the data I&#039;m going to send?

For the Java part, it&#039;s straightforward how to manually decompress the content, but what do I have to insert here to compress the POST data?

(...)
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] init];
[request setURL: serverURL];
[request setHTTPMethod:@&quot;POST&quot;];
[request setValue:@&quot;text/xml; charset=utf-8&quot; forHTTPHeaderField:@&quot;Content-Type&quot;];
[request addValue:@&quot;gzip&quot; forHTTPHeaderField:@&quot;Accepts-Encoding&quot;];

NSString *xmlRequest = [self getTheDataToPostAsXML];
[request setHTTPBody:[xmlRequest dataUsingEncoding:NSUTF8StringEncoding]];
	
NSURLConnection* connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
(...)

Thanks for your help,
Pascal</description>
		<content:encoded><![CDATA[<p>Yes, are there any experiences with compressing the data I&#8217;m going to send?</p>
<p>For the Java part, it&#8217;s straightforward how to manually decompress the content, but what do I have to insert here to compress the POST data?</p>
<p>(&#8230;)<br />
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] init];<br />
[request setURL: serverURL];<br />
[request setHTTPMethod:@"POST"];<br />
[request setValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];<br />
[request addValue:@"gzip" forHTTPHeaderField:@"Accepts-Encoding"];</p>
<p>NSString *xmlRequest = [self getTheDataToPostAsXML];<br />
[request setHTTPBody:[xmlRequest dataUsingEncoding:NSUTF8StringEncoding]];</p>
<p>NSURLConnection* connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];<br />
(&#8230;)</p>
<p>Thanks for your help,<br />
Pascal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Hill</title>
		<link>http://iPhoneDeveloperTips.com/cocoa/how-to-download-and-process-gzipd-data.html#comment-169</link>
		<dc:creator>Aaron Hill</dc:creator>
		<pubDate>Sun, 11 Jan 2009 04:23:04 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=773#comment-169</guid>
		<description>What about the inverse, gzip encoding on the phone before sending an HTTP post?</description>
		<content:encoded><![CDATA[<p>What about the inverse, gzip encoding on the phone before sending an HTTP post?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rodney Aiglstorfer</title>
		<link>http://iPhoneDeveloperTips.com/cocoa/how-to-download-and-process-gzipd-data.html#comment-58</link>
		<dc:creator>Rodney Aiglstorfer</dc:creator>
		<pubDate>Thu, 16 Oct 2008 04:32:57 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=773#comment-58</guid>
		<description>Although not required, it is recommended that you tell the webservice that you are a client capable of supporting gzip content.  By default, even though the iPhone NSURLConnection is capable, it doesn&#039;t add the required header to a request that will announce that fact formally.

To add the header to your request on iPhone you can do something like this


NSMutableURLRequest *request = ...
[request addValue:@&quot;gzip&quot; forHTTPHeaderField:@&quot;Accepts-Encoding&quot;];
</description>
		<content:encoded><![CDATA[<p>Although not required, it is recommended that you tell the webservice that you are a client capable of supporting gzip content.  By default, even though the iPhone NSURLConnection is capable, it doesn&#8217;t add the required header to a request that will announce that fact formally.</p>
<p>To add the header to your request on iPhone you can do something like this</p>
<p>NSMutableURLRequest *request = &#8230;<br />
[request addValue:@"gzip" forHTTPHeaderField:@"Accepts-Encoding"];</p>
]]></content:encoded>
	</item>
</channel>
</rss>

