Answer Posted / 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 |
Post New Answer View All Answers
How can you display all validation messages in one control?
What is caching in asp.net?
Explain difference between dataset and recordset?
What are the page life cycle events?
Explain client-side scripting?
Is redux flux?
What is Web API?
Differentiate between namespace and assembly.
Why is mvc better than asp.net?
Explain the difference between page.registerclientscriptblock and page.registerstartupscript?
What is the purpose of using MVC programming pattern in ASP.NET?
What is asp.net and ado net?
Explain the significance of routing? : asp.net mvc
Define dll hell?
how to include timer or counting time to display next page in asp.net