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

  • Matthew Smith

    Matthew Smit

    24 Mayıs 2010
  • Moto Journal

    Moto Journal

    28 Mayıs 2007
  • TimMinchinLive

    TimMinchinLi

    23 ŞUBAT 2009