SORU
7 NİSAN 2010, ÇARŞAMBA


Android: Nasıl HttpClient bir istek durumu kodu almak

Bir dosya indirmek istiyorum ve yanıt durum kodu (yani HTTP /1.1 200 OK) kontrol etmeniz gerekir. Bu benim kod kesti

HttpGet httpRequest = new HttpGet(myUri);
HttpEntity httpEntity = null;
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = httpclient.execute(httpRequest);
...

Nasıl durumu kodu yanıt alabilirim?

CEVAP
7 NİSAN 2010, ÇARŞAMBA


Bu int değerini döndürür:

response.getStatusLine().getStatusCode()

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

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • case LianLi

    case LianLi

    28 Mayıs 2010
  • Dirty Loops

    Dirty Loops

    21 Mayıs 2007
  • jonathepianist

    jonathepiani

    31 Temmuz 2008