How do you construct HtmlResponseMessage?
Answer / 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 |
Explain about consistent programming model in the .NET framework?
Difference Between ReadOnly and Constant Variable in compile time and Run Time.
3 Answers Phoenix Technologies, Quadrant,
Which is faster viewbag or viewdata?
A web service can only be written in .net? State whether true or false.
What are the types of assemblies and where can u store them and how a private assembly is used only by a single application, and is stored in that application's install directory (or a subdirectory therein)?
Explain what a diffgram is, and a good use for one?
Define viewstate in .net?
What is razor? : asp.net mvc
How to reduce the width of textbox in editcommandcolumn of datagrid?
Define what is razor? : asp.net mvc
What ports must be open for DCOM over a firewall? What is the purpose of Port 135?
calling result set one procedure to anothar procedure in sql2000