Sonobjectrequest actuallyaccepts Jsonobject as body.
From http://arnab.ch/blog/2013/08/asynchronous-http-requests-in-android-using-volley/
Final StringUrl= "Some/url";final jsonobject Jsonbody = /* ... */;new jsonobjectrequest ( url, Jsonbody, new response. Listener<jsonobject> () { ... });
Here is the offical code and Javadoc (@param jsonrequest):
span>
/** * Creates a new request. * @param method The HTTP method to use * @param URL URL to fetch the JSON from * @param jsonrequest A {@link Jsonobject} t O post with the request. Null is allowed and * indicates no parameters would be a posted along with request. * @param listener Listener to receive the JSON response * @param errorlistener Error Listener, or null to ignore errors. */Public Jsonobjectrequest(IntMethod, StringUrl, JsonobjectJsonrequest, Listener<Jsonobject>Listener, Errorlistener Errorlistener) { super (method, URL , (jsonrequest == null) ? Span class= "KWD" >null : Jsonrequest.tostring (), Listener,} /span>