Hi guys
Have anyone had this problem with empty parameters when doing a post?
I have an app that uses the volley lib for posting some parameters and headers to a server.
When the app is in debug mode, and testing volley against a localhost node server over HTTP, it works perfectly.
But when the app is in production mode, with volley requests going against a remote node server (exact same code as the local one), and with HTTPS, the parameters turns up empty on the server...
The request is made, and the header still works though... but the post body/json params are now empty.
Here is the code (a bit edited) that im using:
Has anyone experienced this before?
Map<String, String> jsonParams = new HashMap<String, String>();
jsonParams.put("param1", string1);
jsonParams.put("param2", string2);
new JSONObject(jsonParams),
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
registrationSuccess(response);
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
registrationFailed(error);
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("Content-Type", "application/json");
headers.put("User-agent", "My useragent");
return headers;
}
};
MyApplication.getInstance().addToRequestQueue(registerRequest, "tag");