英文:
Add empty array as a query param
问题
我卡在这个问题上:
我需要创建这个网址
.../check?variables=[]&last_name=name&...
所以我正在使用com.ning.http.client.RequestBuilder来构建我的请求
我尝试过这样做,但由于某种原因它不起作用
RequestBuilder reqBuilder = new RequestBuilder()
.setUrl(url+"/check")
.setMethod("GET")
.setHeader("Bauth-Token", token)
.addQueryParam("variables","")
.setQueryParams(params);
请给予建议,我应该怎么做。
英文:
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.
答案1
得分: 2
如果您希望 variables
的值为 []
,为什么要将其设置为空字符串?
英文:
If you want variables
to have the value []
, why do you set it to an empty string?
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论