你可以使用addPostValue方法来发送相同name的多个数据(梦维:服务端会以数组方式呈现):
-
- ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
- [request addPostValue:@"Ben" forKey:@"names"];
- [request addPostValue:@"George" forKey:@"names"];
- [request addFile:@"/Users/ben/Desktop/ben.jpg" forKey:@"photos"];
- [request addData:imageData withFileName:@"george.jpg" andContentType:@“image/
- for (int i = 0; i < noteImg.count; i++) {
[request addData:noteImg[i] forKey:@"noteImg"];
}
[request setPostValue:content forKey:@"content"];
for (NSString *str in markName) {
[request setPostValue:str forKey:@"markName"];
}