Data compression between iOS and .NET WebAPI

There will be iOS Appand .NET WebApithat will require synchronization of large data or records.

We need to have the compression memory as iOS, and the .NET WebApi, which will be compress, and decompressthe data, and then further processes.

On the side of the iOS application, we plan to use GZipcompression in memory using something like below -

http://www.clintharris.net/2009/how-to-gzip-data-in-memory-using-objective-c/

http://www.deusty.com/2007/07/gzip-compressiondecompression.html

On the .Net WebApi side, we planned to use GZip compression, https://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream%28v=vs.110%29.aspx

Now my question is

Is it possible to use a class GZipStreamin .Net to compress a string JSON? In .Net, the data will be retrieved from the database in the model, and then the models will be converted to JSON strings, and then this string must be compressed before sending to the device, and the same reverse process will be performed when receiving data from the iOS application.

Is there any other better approach than the higher we planned? Any technical tips, relevant links, or a snippet of code snippet are very helpful.

Solution: Thanks to @puneet to guide this post to get the right solution.

Since my server application is Asp.Net WebPI and does not have any files (html, css, js, etc.) that will be transferred from the server to browsers, like any traditional website. http://forums.asp.net/t/1771770.aspx

IIS , , : http://www.codeproject.com/Articles/186233/Utilize-gzip-compression-in-IIS

GZip , , SO -

: HTTP GET Response

: -API.NET g-ziped

- http://benfoster.io/blog/aspnet-web-api-compression

+4
1

GZipStream .Net JSON? .Net , JSON,

, .

  • IIS , .

, .

(, , ), .

iOS.

, gZipped . [this blog post] (http://blog.kaliatech.com/2013/02/posting-compressed-json-content-to-asp-net-web-api-controller/) . , .

+3

All Articles