Search code examples
javahttp-parametersning

Add empty array as a query param


I'm stucked with this problem: I need to create this url

.../check?variables=[]&last_name=name&...

So I'm using com.ning.http.client.RequestBuilder for building me request I tried doing that way, but it's doesn't work for some reason

RequestBuilder reqBuilder = new RequestBuilder()
                .setUrl(url+"/check")
                .setMethod("GET")
                .setHeader("Bauth-Token", token)
                .addQueryParam("variables","")
                .setQueryParams(params);

Pls, give an advice, what I should do.


Solution

  • If you want variables to have the value [], why do you set it to an empty string?