NSURL *url =@"yourURL"; ASIFormDataRequest*currentRequest =[ASIFormDataRequest requestWithURL:url]; [currentRequest setPostFormat:ASIMultipartFormDataPostFormat];[currentRequest setRequestMethod:@"POST"]; [currentRequest addData:imgData withFileName:@"file" andContentType:@"image/png" forKey:@"yourFileNameOnServer"];//This would be the file name which is accepting image object on server side e.g. php page accepting file [currentRequest setDelegate:self]; [currentRequest setDidFinishSelector:@selector(uploadImageFinished:)]; [currentRequest setDidFailSelector:@selector(uploadImageFailed:)]; [currentRequest startSynchronous]; -(void)uploadImageFinished:(ASIHTTPRequest*)request { //Your request successfully executed. Handle accordingly. } -(void)uploadImageFailed:(ASIHTTPRequest*)request {//Your request failed to execute. Handle accordingly. }
相关推荐
ASIHTTPRequest资源包,下载后添加ASIHTTPRequest相关文件到Xcode项目中
使用iOS SDK中的HTTP网络请求API,ASIHTTPRequest就是一个对CFNetwork API进行了封装,并且使用起来非常简单的一套API,
ios开发框架 ASIHttpRequest 资源来源于网上 非原创
asihttprequest是目前做移动平台游戏上比较便捷的http通信第三方库
ASIHTTPRequest 源码 、底层构架
ASIHTTPRequest实现资源的下载,断点续传
ASIHTTPRequest使用介绍
此为ASIHTTPRequest打包的Frameword,直接导入到工程即可使用。
ASIHTTPRequest 包,及导入办法。而且还有git的官方例子
ASIHTTPRequest+UITableView实现多个下载任务,没用到重用机制,还有没有实现断点续载,很简单的一个demo,相信初学者都能看懂,还写了一些注释。
ASIHTTPRequest是简单易用的,它封装了CFNetwork API。使得与Web服务器通信变得更简单。它是用Objective-C编写的,可以在MAC OS X和iPhone应用中使用。 它适用于执行基本的HTTP请求和互动(或者说是反馈)。...
ASIHTTPRequest网络请求集合,直接引入到项目中使用。
该demo最主要的功能是在用ASIHttpRequest 下载,(当然同样也适用于上传),在弹出的alert框中显示下载(或是上传数据)的进度 在这里注意:如果是下载较大的文件,进度条会缓慢进行;相反如果下载的文件很小,那...
iphone 网络请求 类库 网络处理api iphone 开发必备类库程序源代码
ASIHTTPREQUEST代码详细下载。