>

loginBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) 
{
            String userName = editTextEmail.getText().toString().trim();
            String password editTextPassword.getText().toString().trim();
            String LOGIN_URL = "http://www.someurl.com/Rest/AIwebservice/Authenticate?user="+userName+"&password="+password;
            //String uri = String.format("https://www.auruminfo.com/Rest/AIwebservice/Authenticate?user=subhash&password=Subhash");
            //String uri = String.format("https://www.someurl.com/Rest/AIwebservice/Authenticate?user="+userName+"&password="+password);
            StringRequest sr = new StringRequest(Request.Method.GET,LOGIN_URL,
                    new Response.Listener<String>() {
                        @Override
                        public void onResponse(String response) {
                            Log.e("HttpClient", "success! response: " + response.toString());
                        }
                    },new Response.ErrorListener() {
                        @Override
                        public void onErrorResponse(VolleyError error) {
                            Log.e("HttpClient", "error: error.toString());
                        }
                    })
            {
                @Override
                protected Map<String,String> getParams(){
                    Map<String,String> params = new HashMap<String, String>();
                    params.put("user","");
                    params.put("password","");
                    return params;
                }
                @Override
                public Map<String, String> getHeaders() throws AuthFailureError {
                    Map<String,String> params = new HashMap<String, String>();
                    params.put("Content-Type","application/json;charset=UTF-8");
                    return params;
                }
            };
            queue.add(sr);
        }
    });

}

및 로그 고양이 :-

08-02 18:17:08.778 7070-7091/com.some.eww.logindemo E/Volley: [9414] BasicNetwork.performRequest: Request athttp://www.someurl.com/Rest/AIwebservice/Authenticate?user=&password=has been redirected tohttps://www.someurl.com/Rest/AIwebservice/Authenticate?user=&password= 08-02 18:17:08.794 7070-7070/com.anghatechsolution.eww.logindemo E/HttpClient: error: com.android.volley.RedirectError

  • 답변 # 1

    내 경우에는 String LOGIN_URL = "http://www.someurl.com;에서 문제가 발견되었습니다.

    원래 API는 HTTP가 아닌HTTPS를 사용합니다

  • 이전 php - 선택 태그로 날짜 표시 제한 Wordpress
  • 다음 objective c - 연결/연결 끊김을 감지하는 iOS Bluetooth Central의 안정적인 위임 방법