0

This is my code

Client:

$http({
method: 'POST',
url: Employee/Save,
headers: {'Content-Encoding':'gzip'},
data: { fname :  $scope.fName , lname: $scope.lName}
}).success(function () {});

Controller

public async Task<JsonNetResult> Save(EmployeeModel empData)
{

}

In the above code when i pass Content-Encoding header in http post the employee data not assign the EmployeeModel only null values are assigned. But without passing Content-Encoding header data pass to the MVC controller . Now how to decompress data in MVC when use Content-Encoding:'gzip' in MVC using c#.net.

UPDATE:

public class EmployeeModel { 
    public string fName{ get; set; } 
    public string lName{ get; set; } 
} 
Nkosi
  • 235,767
  • 35
  • 427
  • 472

1 Answers1

1

According to this similar question AngularJS compress $http post data

Angular has no compression utilities.

If you really need to compress then you will have to find a JavaScript library to do so, which I know nothing about, but this question and this question would be good places to start.

Community
  • 1
  • 1
Nkosi
  • 235,767
  • 35
  • 427
  • 472