Skip to main content

Posts

Showing posts with the label How to get custom header value in Web API 2 MVC 5 handler?

get custom header value in Web API 2 MVC 5 handler

Table of Contents $.ajax call with header request. API controller with added route-prefix , route and A ustomAuthFilter attribute. Authorization filter attribute. get custom header value using request header. This is the API base url as given below. var baseURL = "localhost://3456/API/BusinessEntity/GetBusinessEntityDetailByID/1" ; The $. ajax call with header request  $.ajax({             url: baseURL,             type: " POST ",                        data: {},             beforeSend: function (xhr) {                 xhr.setRequestHeader( "UserType" , "admin" );       ...