【发布时间】:2020-08-30 05:45:36
【问题描述】:
这是我正在使用邮递员作为数组测试我的 api
但是如何使用 MultipartRequest 发送数组
var uri = Uri.parse(Constants.BASEURL + Constants.KEYEORD_CREATE_TENANACY);
Map<String, String> headers = {
"Accept": "application/json",
"Authorization": token
};
var request = new http.MultipartRequest("POST", uri);
request.headers.addAll(headers);
request.fields['property_usage'] = property_use;
request.fields['unit_id'] = unitlist; // here i want unit_id to array
var response = await request.send();
print("Tenancy Add Result: ${response.statusCode}");
if (response.statusCode == 200) {
print(response);
}
【问题讨论】:
-
你有什么办法解决这个问题吗?