Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How do you construct HtmlResponseMessage?



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

Post New Answer

More ASP.NET Interview Questions

i want to implement grid view value in paypal site. so how to create this code in asp.net with C#

0 Answers  


What is Difference between Callbacks and Postback in ASP.NET?

11 Answers  


What are the security types in ASP/ASP.NET? Different Authentication modes?

0 Answers  


Difference between asp and asp.net?

4 Answers   Accenture,


What is difference between asp.net and asp?

0 Answers  


Which method is used to enforce garbage collection in .net?

0 Answers  


What is the use of Administration tool in Asp.net 2.0?

2 Answers  


What is difference between web config and global asax?

0 Answers  


Explain the path instructions in xaml?

0 Answers  


How can you get public key information?

1 Answers   Microsoft,


About CLR, reflection and assemblies?

0 Answers   Microsoft,


What is the life-span of the items in the viewstate?

0 Answers  


Categories