Skip to content

Instantly share code, notes, and snippets.

@debugmodedotnet
Created August 14, 2019 16:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save debugmodedotnet/858443ba81814a0c08504de02735522c to your computer and use it in GitHub Desktop.
[Route("Data")]
[HttpGet]
public HttpResponseMessage GetData()
{
HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
response.Content = new StringContent("hello geek97", Encoding.Unicode);
response.ReasonPhrase = "Data is processed";
response.Headers.CacheControl = new CacheControlHeaderValue()
{
MaxAge = TimeSpan.FromMinutes(20)
};
return response;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment