i want to add token to header for webapi request. how can i do this ?
this is my sample code
public IHttpActionResult Authenticate(Login data)
{
var Token = "fdsf123546fskjhf-gsuyuhsh";
//here add these token to header
return ?
}
thank you.
You could use ResponseMessageResult class for that:
Or create your own result class:
Or add a header to any existing IHttpActionResult object using an extension method:
This code working me