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 |
i want to implement grid view value in paypal site. so how to create this code in asp.net with C#
What is Difference between Callbacks and Postback in ASP.NET?
What are the security types in ASP/ASP.NET? Different Authentication modes?
Difference between asp and asp.net?
What is difference between asp.net and asp?
Which method is used to enforce garbage collection in .net?
What is the use of Administration tool in Asp.net 2.0?
What is difference between web config and global asax?
Explain the path instructions in xaml?
How can you get public key information?
About CLR, reflection and assemblies?
What is the life-span of the items in the viewstate?
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)