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 are the Types of authentications in IIS
What is inheritance and an how it be used, example with an example?
How can you dynamically add user controls to a page?
What is the latest version of asp.net?
How will you load dynamic assembly?
Explain how to prepare culture-specific formatting in .net.
Does web services support data reader like pom project?
List of words of preprocessor in .net?
Explain what does wsdl stand for?
Do you know caching feature?
Should I delete cookies?
What are the asp.net security controls?
Explain the difference between globalization and localization techniques
Asp pages that worked pefectly on windows 2000 server and iis 5.0 do not work on windows 2003 server with iis 6.0. Asp.net pages work fine. Why?
What is the use of view state?