使用ASI传递post表单..参数是数组
你可以使用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"];
}
posted on 2015-09-30 17:28 taiyang2014 阅读(123) 评论(0) 编辑 收藏 举报