我正在使用Postman测试我的API,涉及IT技术。以下是需要翻译的内容:
这是我使用Postman作为数组进行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);
}