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

What is a master page and what does it do?

0 Answers  


Way of updating a table other than stored procedure and hard coded query?

2 Answers  


What are runtime hosts?

4 Answers   Microsoft,


From the given paragraph of text, write a program to match the strings of format “Any number of numerals followed by an underscore followed by any number of alphabets" ex:123_abc (Note:using regular expressions)

4 Answers   Microsoft,


write six HTTP request method?

4 Answers   IBM,


What is class and object in asp.net?

0 Answers  


Can you edit data in the Repeater control?

11 Answers   CAC, Creative,


What is difference between web config and global asax?

0 Answers  


What is active web pages?

0 Answers  


How you will improve web application performance?

0 Answers   Wipro,


Explain the difference between overriding and overloading?

0 Answers  


Explain what are webservices?

0 Answers  


Categories