问题
I am using OkHTTP and I have some problems when I try to make a post request.
Here is my code :
client = new OkHttpClient();
formBody = new FormBody.Builder()
.add(Constant.DIRECTION, Constant.OUT)
.add(Constant.LIMIT, Constant.docs_limit)
.add(Constant.IMPORTED, Constant.FALSE)
.addEncoded("statuses[]", "4")
request = new Request.Builder()
.url(url)
.addHeader(Constant.AUTH_TOKEN, sharedPreferences.getString(Constant.TOKEN, ""))
.post(formBody)
.build();
when I try to send
"statuses[]", "4"
in the debugger it shows that brackets converted to "statuses%5B%5D". How to fix that? Sorry for my poor english.
来源:https://stackoverflow.com/questions/43977865/okhttp-bad-requestbody