How do you construct HtmlResponseMessage?
Answer / nirav desai
Following is the way to construct to do so,
public class TestController : ApiController
{
public HttpResponseMessage Get()
{
HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, "value");
response.Content = new StringContent("Testing", Encoding.Unicode);
response.Headers.CacheControl = new CacheControlHeaderValue()
{
MaxAge = TimeSpan.FromMinutes(20)
};
return response;
}
}
Is This Answer Correct ? | 0 Yes | 0 No |
What is session and application variable in asp net?
What is asp.net ajax?
Difference between datagrid and datareader?
How do cookies work? Give an example of their abuse.
What data types do the RangeValidator control support?
What is dataset and uses of dataset ?
Is it possible to use two versions of assembly at the same time?If possible explain with code?
What is a ashx file?
About Usage of server variables ?
How to use DevExpress controls
How long do session variables last?
What is manifest in .net framework?