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
What does ascx stand for?
Explain how asp.net page works?
What is a 401 redirect?
What is page fragment caching?
Which is an advantage of application service providers?
What is .net remoting?
What is a user session?
What is the difference between ASP Session State and ASP.Net Session State?
What is use of Master Page in ASP.NET web pages?
What are validator? Name the validation controls in asp.net?
What is asp.net master page?
What is difference between web api and web services?
What are directives in asp.net? List down all the important directives.
List of words of preprocessor in .net?
Explain the purpose of storyboard.targetproperty.