I have get problem "Unexpected response code 500", when I access URL API.
This my code with volley library:
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 have set permission Internet on my manifest.
If URL I copy on browser, this is responded, I can accesses but if I put in my code, I get Error 500.
NB : URL this only IP address, cause this is IP address my VPS server and I'm not yet set domain my server...
How can I fix it? Sorry for my english.