Until now, I had a GET
method that looked like the following:
protected override async Task GetAll(QueryData query)
{
You can explicitly add custom headers in a method like so:
[HttpGet]
[Route("home/students")]
public HttpResponseMessage GetStudents()
{
// Get students from Database
// Create the response
var response = Request.CreateResponse(HttpStatusCode.OK, studends);
// Set headers for paging
response.Headers.Add("X-Students-Total-Count", studends.Count());
return response;
}
For more information read this article: http://www.jerriepelser.com/blog/paging-in-aspnet-webapi-http-headers/