For ASP.Net Core there is an easy solution if want to use the param directly in the controller method: Use the [FromHeader] annotation.
public JsonResult SendAsync([FromHeader] string myParam)
{
if(myParam == null) //Param not set in request header
{
return null;
}
return doSomething();
}
Additional Info: In my case the "myParam" had to be a string, int was always 0.