I am trying to connect API url=\"api adress\" which accepts two header types application/json to reponce in json and application/xml to reponce in xml. I need to hit JSON wi
Volley will ignore your Content-Type
setting, if you want to modify the content-type, you can override the getBodyContentType
method :
JsonObjectRequest jsonObjReq = new JsonObjectRequest(Method.POST, url,
new JSONObject(params), response, response_error) {
@Override
public String getBodyContentType() {
return "application/json; charset=utf-8";
}
}
for why volley ignore your parameters? take a look at my another answer.
Volley JsonObjectRequest Post request not working
Take the other answer from that post wich starts with: You can create a custom JSONObjectReuqest