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

  • Doc Adams

    Doc Adams

    20 HAZİRAN 2007
  • kremosakhaz

    kremosakhaz

    25 AĞUSTOS 2006
  • Theodore Leaf

    Theodore Lea

    29 AĞUSTOS 2006