1
我使用下面的代碼來獲得S3桶的項目清單:我可以得到JSON響應而不是xml嗎?在ASIs3bucketRequest
ASIS3BucketRequest *request = [ASIS3BucketRequest requestWithBucket:@"my-bucket"];
NSString *key = kS3SecretKey;
[request setSecretAccessKey:key];
key = kS3AccessKey;
[request setAccessKey:key];
[request setMaxResultCount:50]; // Max number of results we want
[request setDelegate:self];
[request setDidFailSelector:@selector(requestContentListFromBuckeFailed:)];
[request setDidFinishSelector:@selector(requestContentListFromBuckeSuccessfull:)];
[request startAsynchronous];
當我收到respose和記錄它。這是XML的形式
-(void) requestContentListFromBuckeSuccessfull: (id) request
{
NSString *response = [[NSString alloc] initWithData:[request responseData] encoding:NSUTF8StringEncoding];
NSLog(@"response=%@",response);
}
我的問題是,我可以設置爲接收JSON響應的請求?
這很糟糕,但我認爲你是對的。謝謝您的回答。 –