0

ユーザー名とパスワードは正しいが、isResponse() メソッドが false を返す

私たちのコードが正しいかどうか助けてください。

           public boolean isUserAvailable() {
    // Create a new HttpClient and Post Header
    try {
    HttpClient httpclient = new DefaultHttpClient();

    HttpPost httppost = new HttpPost(Commons.IS_USER_AVAILABLE_NEW_REGISTRATION_LINK
                    + edit_USERNAME.getText().toString().trim());


        // Execute HTTP Post Request
        HttpResponse response = httpclient.execute(httppost);
        HttpEntity resEntity = response.getEntity();

        if ("available".equalsIgnoreCase(EntityUtils.toString(resEntity))) {
            return true;
        }
    } catch (ClientProtocolException e) {
        Toast.makeText(getApplicationContext(), "error"+e, Toast.LENGTH_LONG).show();

    } catch (IOException e) {
        Toast.makeText(getApplicationContext(), "error"+e, Toast.LENGTH_LONG).show();

    }
    return false;

}
4

0 に答える 0