In controller I am trying to return HTTP request string, Can some one help on this?
public class TestController : ApiController
{
public string Get()
{
//var sr = new StreamReader(HttpContext.Current.Request.InputStream).ReadToEnd();
//new System.IO.StreamReader(Request.Body).ReadToEnd()
//String Sd = sr;
//return Sd;
var httpContext = (HttpContextWrapper)Request.Properties["MS_HttpContext"];
var foo = httpContext.Request.Form["jsonRequest"];
return foo; //This is value passed in request
}
}
In controller I am trying to return HTTP request string, Can some one help on this?
public class TestController : ApiController { public string Get() { //var sr = new StreamReader(HttpContext.Current.Request.InputStream).ReadToEnd(); //new System.IO.StreamReader(Request.Body).ReadToEnd() //String Sd = sr; //return Sd; var httpContext = (HttpContextWrapper)Request.Properties["MS_HttpContext"]; var foo = httpContext.Request.Form["jsonRequest"]; return foo; //This is value passed in request } }