Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
azzlack committed May 15, 2014
1 parent d559475 commit de55daa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ Microsoft.AspNet.WebApi.MessageHandlers.Compression
Drop-in module for ASP.Net WebAPI that enables `GZip` and `Deflate` support


### How to use
#### Server side
## How to use
### Server side
You need to add the compression handler as the last applied message handler on outgoing requests, and the first one on incoming requests.
To do that, just add the following line to your `App_Start\WebApiConfig.cs` file after adding all your other message handlers:
```csharp
GlobalConfiguration.Configuration.MessageHandlers.Insert(0, new CompressionHandler(new GZipCompressor(), new DeflateCompressor()));
```
This will insert the `CompressionHandler` to the request pipeline as the first on incoming requests, and the last on outgoing requests.

#### Client side
### Client side

##### JavaScript
#### JavaScript
If you are doing your requests with `JavaScript` you probably don't have to do do anything.
Just make sure the `gzip` and `deflate` values are included in the `Accept-Encoding` header. (Most browsers do this by default)

##### C\#
#### C\#
You need to apply the following code when creating your `HttpClient`, depending on the request type.

**GET requests**
Expand Down

0 comments on commit de55daa

Please sign in to comment.