2012-11-27 305 views
1

如何通过HTTP POST发送图像数据?通过HTTP POST发送图像数据

我有以下代码:要做到这一点是通过做多图片上传但是这不会是JSON格式

NSURL *aUrl = [NSURL URLWithString:@"http://demo25.projectproofonline.com/soul_mate_modified/save.php"]; 
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:aUrl 
cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; 
[request setHTTPBody:[postString dataUsingEncoding:NSUTF8StringEncoding]]; 
[request setHTTPMethod:@"POST"]; 
[NSURLConnection connectionWithRequest:request delegate:self]; 

回答