I'm using AngularJS $http to send data to my Web API server. If I use the GET method the array will be null on the server. Using the POST method all works fine. What is the correct way to send array using the GET method?
----GET----
Client-Side:
$http({
method: 'GET',
url: '/api/Status',
headers: { 'Authorization': $localStorage.accesstoken },
data: statusID
})
Server-Side:
[HttpGet]
public async Task<List<StatusForUpdate>> GetStatus([FromUri] List<int> StatusID)
{ ... }
----POST----
Client-Side:
$http({
method: 'POST',
url: '/api/Status',
headers: { 'Authorization': $localStorage.accesstoken },
data: statusID
})
Server-Side:
[HttpPost]
public async Task<List<StatusForUpdate>> GetStatus(List<int> StatusID)
{ ... }