Consider the following class
public class StController:apicontroller {
public void PostBodyMethod() {
HttpRequestMessage request=this.request;
//How to read the header and body parameters
}
}
The applet sends both the header and body parameters to the post method.
How to retrieve the information which is sent along with post method inside the webapi controller using the HttpRequestMessage object?
If the body parameter is a JSON object, all what you need is to just pass Model parameter in Post method. Web API supports json by default. You might need to read this.
To reader headers in HttpRequest, you can use:
Sample code: