标签:request code 网络 article mod input nsurl http请求 track
iOS 发送http请求时,须要发送图片或者视频等大容量数据内容,使用输入流是最佳的选择
NSURL *url = [NSURL URLWithString:@""]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; NSInputStream *insetream = [NSInputStream inputStreamWithFileAtPath:@"路径"];//加入文件路径 [request setHTTPBodyStream:insetream]; [request setHTTPMethod:@"POST"];
标签:request code 网络 article mod input nsurl http请求 track
原文地址:http://www.cnblogs.com/jzdwajue/p/6918136.html