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 |
Why and where this web.config file is used?
Can we create a multiple user simultaneously ?
Explain the server control events of asp.net ?
What is asp.net mvc? : asp.net mvc
Explain the difference between Repeater and Data list control in ASP.NET?
Why we go for mvc instead of asp.net? : Asp.Net MVC
Explain repository pattern in asp.net mvc? : asp.net mvc
How to do state management in ASP.NET?
how many select state ments are used in stored procedure?
Do I need to have the latest version of windows media player installed?
What is the difference between viewstate and hidden field in asp.net?
How do you relate an aspx page with its code behind Page?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)