[HttpGet] [DeflateCompression] public HttpResponseMessage Get() { var response = new HttpResponseMessage(); try { StringBuilder SBHtmltags = new StringBuilder(); response.Content = new StringContent("test compression data"); response.Content.Headers.ContentType = new MediaTypeHeaderValue("text/html"); } catch (Exception ex) { return ControllerContext.Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message); } return response; }
$.ajax({ type: 'GEt', url: URI, contentType: 'application/json; charset=utf-8', data: ContentDataObject, AcceptEncoding: "gzip, deflate, sdch", dataType: 'text', accept: 'application/json charset=utf-8' }).done(function (ResultData) { $('#dvResult').text(ResultData); }).error(function (jqXHR, textStatus, errorThrown) { $('#dvResult').text(jqXHR.responseText || textStatus); });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)