[Jersey] How to give a json string to a webservice method

From: Asuka <>
Date: Wed, 6 Apr 2011 15:06:46 -0700 (PDT)

Hi there,

I use a jersey webservice and I want to give the webservice method a

this is the method:

public String search(@QueryParam("token") String token,
        @QueryParam("searchString") String searchParams)

so I define my searchString of the Type JSONObject in the client and call
the webservice method:
HttpGet requesttest = new
but trying this throws the exception that there is a illegal character in
the query. I´m sure it is because of :

If I change to post it looks like this:
HttpPost requestPost = new HttpGet("http:/");
List params = new ArrayList();
params.add(new BasicNameValuePair("token", cursor.getString(0)));

but I don´t know how to use the searchstring in the search method of the
webservie now.

does anybody know how to solve the problem?

best wishes

View this message in context:
Sent from the Jersey mailing list archive at