Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dotmorten/sharpgis.gzipwebclient
GZip WebClient for Windows Phone
https://github.com/dotmorten/sharpgis.gzipwebclient
Last synced: 5 days ago
JSON representation
GZip WebClient for Windows Phone
- Host: GitHub
- URL: https://github.com/dotmorten/sharpgis.gzipwebclient
- Owner: dotMorten
- Created: 2012-02-22T04:20:55.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-03-02T22:07:47.000Z (over 10 years ago)
- Last Synced: 2024-06-19T00:24:41.304Z (5 months ago)
- Language: C#
- Homepage: http://www.sharpgis.net/post/2011/08/28/GZIP-Compressed-Web-Requests-in-WP7-Take-2.aspx
- Size: 321 KB
- Stars: 19
- Watchers: 8
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
###GZip Compression for Windows Phone WebClient
UPDATE: THIS PROJECT HAS BEEN DISCONTINUED. PLEASE USE THE OFFICIAL MICROSOFT PROVIDED HTTP CLIENT LIBRARY: https://www.nuget.org/packages/Microsoft.Net.Http
Now that Microsoft finally provides GZip compression for Windows Phone, I encourage you to use their official nuget package instead.
======================
(c) Copyright Morten Nielsen.
This source is subject to the Microsoft Public License (Ms-PL).
Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
All other rights reserved.Available for direct install from NuGet: https://nuget.org/packages/SharpGIS.GZipWebClient
To use this code, explicitly use the SharpGIS.GZipWebClient class where you would normally use a WebClient instance. Ex:
```c-sharp
WebClient client = new SharpGIS.WebClient(); //Yes the type is still WebClient since that's what it inherits from :-)
//continue with this WebClient as you used to
```
Or you can automatically opt in for all existing WebClients by adding the following code during application start up:
```c-sharp
WebRequest.RegisterPrefix("http://", SharpGIS.WebRequestCreator.GZip);
WebRequest.RegisterPrefix("https://", SharpGIS.WebRequestCreator.GZip);
```
This will change ALL web requests both those that uses WebClient and those that uses the lower-level HttpWebRequest, as well as any 3rd party library to start using compressed requests. Please test thoroughly - I've seen some issues with a few 3rd party libraries that doesn't work well with a different HttpWebRequest object, but for the most part this just works.Blogpost on this utility available here: http://www.sharpgis.net/post/2011/08/28/GZIP-Compressed-Web-Requests-in-WP7-Take-2.aspx