Volleyball 500 feedback response code
I always get below error response when using volley
06-24 15:06:59.244: E/Volley(12869): [2311] BasicNetwork.performRequest: Unexpected response code 500 for http://My_API
my code for calling Volley
String sSignupUrl = STController.getInstance()
.getResourceManager(LoginActivity.this)
.getServerPropertyValue(URLConstants.API_LOGIN);
JSONObject params = new JSONObject();
try {
params.put("username", "usernam");
params.put("passwd", "password");
} catch (JSONException e) {
e.printStackTrace();
}
JsonObjectRequest jsonObjReq = new JsonObjectRequest(Method.POST,
sSignupUrl, params, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
LogUtil.d("TAG" + response.toString());
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
VolleyLog.d("TAG", "Error: " + error.getMessage());
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("Content-Type", "application/json; charset=utf-8");
return headers;
}
};
// Adding request to request queue
AppController.getInstance().addToRequestQueue(jsonObjReq);
I can successfully get the answer when using the URLConnection dispatcher, unable to find the error, I have a google search but dont get the correct solution, all answers are most welcome Thanks in advance
+3
source to share