I am having the "Unexpected 500 response code" problem when I get the API URL.
This is my volleyball library code:
String url= "http://103.241.24.35/android/android_login_api/index.php"; public void detailURL(String url) { Log.v("Android Spinner JSON Data Activity", url); queue = Volley.newRequestQueue(this); StringRequest sr = new StringRequest(Request.Method.POST,url, new Response.Listener<String>() { @Override public void onResponse(String response) { ProgressLoadStartLogin.setVisibility(View.GONE); displaystatis_kontenDetail(response); btn_enable(); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { if( error instanceof NetworkError) { } else if( error instanceof ServerError) { } else if( error instanceof AuthFailureError) { } else if( error instanceof ParseError) { } else if( error instanceof NoConnectionError) { } else if( error instanceof TimeoutError) { } statusKoneksi(); btn_enable(); ProgressLoadStartLogin.setVisibility(View.GONE); } }){ @Override protected Map<String,String> getParams(){ Map<String,String> params = new HashMap<String, String>(); params.put("tag",Variabel.login_tag); params.put("username",user); params.put("password", password); params.put("idgcm",GCMid); return params; } @Override public Map<String, String> getHeaders() throws AuthFailureError { Map<String,String> params = new HashMap<String, String>(); params.put("Content-Type","application/x-www-form-urlencoded"); return params; } }; queue.add(sr); }
And I set the Internet permission to my manifest.
If the URL is copied in the browser, this is the answer, I can access it, but if I put in my code, I will get Error 500.
NB : The URL of this is only IP addresses, because it is the IP address of my VPS server, and I have not configured my server domain yet ...
How can i fix this? Sorry for my English.
source share