forum

Home / DeveloperSection / Forums / Passing a parameter from request header to the API controller action method

Passing a parameter from request header to the API controller action method

Anonymous User 1744 17-Nov-2014

I am using WEB API 2.0 for REST Service development and I need to pass a parameter from request header to the API controller action method. How can I? 

By default API controller is reading the parameters from request body. How can I make it read parameter from request header? 

[HttpPost]
[Route("abc")]
public IHttpActionResult abcMethod(string s)
{
   //some code
}

I want the above abcMethod to read it's parameter from request header.

Pls suggest.


Updated on 17-Nov-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By