我正在尝试使用阿拉伯数值发送参数,但它会更改 exتجربه将变为*,1(G
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> params = new HashMap<String, String>();
params.put("Accept", "application/json;");
params.put("Authorization", "Bearer " + token);
// params.put("Content-Type", "application/json; charset=utf-8");
return params;
}
@Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<>();
params.put("title", title);
params.put("description", description);
params.put("score", score);
params.put("question_link", "https://mail.zoho.com/zm/#mail/folder/inbox");
params.put("deadline", deadline);
if (subject_id.size() > 0) {
for (int i = 0; i < subject_id.size(); i++) {
params.put("data[" + i + "][subject_id]", subject_id.get(i));
params.put("data[" + i + "][class_id]", class_id.get(i));
// params.put("data[" + i + "]","[subject_id:"+ subject_id.get(i)+",class_id:"+class_id.get(i)+"]");
}
}
params.put("school_id", school_id);
Log.d("PARAMS", params.toString());
return params;
}
@Override
protected Map<String, VolleyMultipartRequest.DataPart> getByteData() {
Map<String, DataPart> params = new HashMap<>();
if (fileNames.size() > 0) {
params.put("files[0]", new VolleyMultipartRequest.DataPart(fileNames.get(0),
AppHelper.convertFileToByteArray(getApplicationContext(), fileuri)));
}
return params;
}
};
multipartRequest.setRetryPolicy(new DefaultRetryPolicy(
30000,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
VolleySingleton.getInstance(getBaseContext()).addToRequestQueue(multipartRequest);
我尝试发送带有接受的charset = utf-8作为application / json; charset = utf-8;但是什么也没发生,尽管如此,altho尝试将charset = utf-8 int内容类型与multipart / form-data一起发送,但这给了我错误