I want to post boolean,double data using volley library.I am not getting how to use it.Is there any other process.Thanks in advance.
Here is my method....
If you have a custom Request, you could just override the getBody method and go to town:
@Override
public byte[] getBody(){
JSONObject jsonObject = new JSONObject();
String body = null;
try{
//Here are your parameters:
jsonObject.put("name", "geronimous");
jsonObject.put("age", 998);
jsonObject.put("happy", true);
body = jsonObject.toString();
} catch (JSONException e){
e.printStackTrace();
}
try{
return body.toString().getBytes("utf-8");
} catch (UnsupportedEncodingException e){
e.printStackTrace();
}
return null;
}
Just make sure you have the content type as application/json on the headers