java - Using the jersey client to do a POST operation with request params and a request body -



java - Using the jersey client to do a POST operation with request params and a request body -

i'm trying figure how how utilize bailiwick of jersey client send both request params , request body of post operation.

currently know how both of way individually, not together.

from here: using bailiwick of jersey client post operation

i've gotten request parms:

multivaluedmap formdata = new multivaluedmapimpl(); formdata.add("name1", "val1"); formdata.add("name2", "val2"); clientresponse response = webresource.type("application/x-www-form-urlencoded").post(clientresponse.class, formdata);

and request body can following:

string jsonobject ="... valid json object"; webresource.type(mediatype.application_json_type).post(string.class, jsonobject);

how post both request param request body?

thanks

i figured out..

webresource.queryparam("key", "value").type(mediatype.application_json_type).post(string.class, jsonobject);

java java-ee jersey

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -