function postHeader()
{
$.ajax({
url : "/myTest/PostHeader?time="+ (new date()).getTime(),
beforeSend :function (xhr){
xhr.setRequestHeader("myValue ","aaa");
},
type:"Get",
success:function(data)
{
alert(data);
}
});
}
public IActionResult GetAjaxValue([FromHeader] string myValue )
{
// JsonResult jr=new JsonResult(new { Name="张三",value=MyValue});
// return jr;
return Json(new { Name="张三",value=MyValue}); // 效果和上面一样
}