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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you display all validation messages in one control?

1040


What is caching in asp.net?

1058


Explain difference between dataset and recordset?

1113


What are the page life cycle events?

961


Explain client-side scripting?

1060


Is redux flux?

1002


What is Web API?

1238


Differentiate between namespace and assembly.

1025


Why is mvc better than asp.net?

1116


Explain the difference between page.registerclientscriptblock and page.registerstartupscript?

1062


What is the purpose of using MVC programming pattern in ASP.NET?

1074


What is asp.net and ado net?

1055


Explain the significance of routing? : asp.net mvc

1097


Define dll hell?

1130


how to include timer or counting time to display next page in asp.net

2196