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

Why and where this web.config file is used?

0 Answers   Amazon,


Can we create a multiple user simultaneously ?

0 Answers   MCN Solutions,


Explain the server control events of asp.net ?

0 Answers  


What is asp.net mvc? : asp.net mvc

0 Answers  


Explain the difference between Repeater and Data list control in ASP.NET?

0 Answers  


Why we go for mvc instead of asp.net? : Asp.Net MVC

0 Answers  


Explain repository pattern in asp.net mvc? : asp.net mvc

0 Answers  


How to do state management in ASP.NET?

0 Answers   BirlaSoft,


how many select state ments are used in stored procedure?

8 Answers   CSC,


Do I need to have the latest version of windows media player installed?

0 Answers  


What is the difference between viewstate and hidden field in asp.net?

0 Answers  


How do you relate an aspx page with its code behind Page?

2 Answers   Accenture,


Categories