diff --git a/README.md b/README.md index dcfd714..cb3168c 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ 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 @@ -13,13 +13,13 @@ GlobalConfiguration.Configuration.MessageHandlers.Insert(0, new CompressionHandl ``` 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**