使用ASIHttpRequest将照片上传到Flickr
问题描述:
我正在尝试使用ASIHttpRequest将照片上传到Flickr。 我可以让用户授权应用程序并获取访问令牌。然后,当我尝试上传照片的时候失败,出现以下错误使用ASIHttpRequest将照片上传到Flickr
“没有错误域= ASIHTTPRequestErrorDomain代码= 3 ”需要身份验证 “ 的UserInfo = 0x9757d0 {NSLocalizedDescription =验证 需要}”
图片是我想上传的照片,
ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:[NSUrl urlWithString:@"http://api.flickr.com/services/upload/"] autorelease];
NSData *data = UIImagePNGRepresentation(aJob.image);
[request setPostValue:FLICKR_SECRET_KEY forKey:@"api_key"];
[request setPostValue:accessToken forKey:@"auth_token"];
[request setData:data withFileName:fileName andContentType:@"image/jpeg" forKey:@"photo"];
任何提示? 感谢