SORU
22 ŞUBAT 2011, Salı


Nasıl MVC 3 denetleyici ASP.NET 200 HTTP Durum Kodu dönmek

Üçüncü parti bir hizmet SONRASI veri kabul eden bir uygulama yazıyorum.

Bu veri gönderildiğinde 200 HTTP Durum Kodu dönmek zorundayım.

Nasıl benim denetleyicisi bu yapabilirim?

CEVAP
1 ŞUBAT 2012, ÇARŞAMBA


Kumandanız böyle bir HttpStatusCodeResult döneceğini...

[HttpPost]
public ActionResult SomeMethod(...your method parameters go here...)
{
   // todo: put your processing code here

   //If not using MVC5
   return new HttpStatusCodeResult(200);

   //If using MVC5
   return new HttpStatusCodeResult(HttpStatusCode.OK);  // OK = 200
}

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Ionized Digital Air Studios

    Ionized Digi

    20 HAZİRAN 2009
  • NYCarspotter

    NYCarspotter

    26 EYLÜL 2011
  • TheOtherMau5

    TheOtherMau5

    6 Mart 2012