我要把图片换成nsdata,然后再用base64encoding,把encoding后生成的字符串上传到服务器,就出这个问题,报错信息:err:ErrorDomain=com.alamofire.error.serialization.responseCode=-1011"Requestfailed:请求太大(413)"我同事用的ASIHTTPRequest库就没问题,请问如何解决?代码:UIImage*img=[selfcreateThumbnailWithSourceImge:sourceImgandNewSize:sz];data=UIImageJPEGRepresentation(img,0.01);NSString*encodedSTR=[database64Encoding];NSString*currentUrl=@"/app/b/test";NSString*urlStr=[NSStringstringWithFormat:@"%@%@?picStr=%@",BASEURL,currentUrl,encodedSTR];NSURL*url=[NSURLURLWithString:urlStr];NSURLRequest*request=[NSURLRequestrequestWithURL:url];AFHTTPRequestOperation*op=[[AFHTTPRequestOperationalloc]initWithRequest:request];op.responseSerializer=[AFJSONResponseSerializerserializer];[opsetCompletionBlockWithSuccess:^(AFHTTPRequestOperation*operation,idresponseObject){//NSLog(@"success:%@",responseObject);successBlock(responseObject);}failure:^(AFHTTPRequestOperation*operation,NSError*error){failureBlock(error);}];[opstart];//[managerPOST:urlStrparameters:nil//success:^(AFHTTPRequestOperation*operation,idresponseObject){//NSLog(@"success:%@",responseObject);//}failure:^(AFHTTPRequestOperation*operation,NSError*error){//NSLog(@"err:%@",error);//}];
守候你守候我
相关分类