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 asp.net mvc differs from asp.net web forms? : asp.net mvc
What is xaml? Are xaml file compiled or built on runtime?
Explain about solution explorer window?
What are the various session state management options provided by asp.net?
How do you store a value in viewstate and retrieve them?
What is the difference between web.config and machine.config in ASP.NET?
Explain the difference between mvc (model-view-controller) and mvp (model-view-presenter)? : asp.net mvc
How to create events for a control?
What is bson in web api?
witch is the best insistute in sharpoint course.what abt future of share point course.
Are cookies client side or server side?
Differences between “dataset” and “datareader”.
Explain the page lifecycle of an asp.net mvc? : asp.net mvc
Explain the difference between asp.net mvc and asp.net webforms? : asp.net mvc
What is masterpage?