我正在使用以下代码获取 s3-bucket 中的项目列表:
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];
当我收到响应并记录它时。它是xml的形式
-(void) requestContentListFromBuckeSuccessfull: (id) request
{
NSString *response = [[NSString alloc] initWithData:[request responseData] encoding:NSUTF8StringEncoding];
NSLog(@"response=%@",response);
}
我的问题是我可以将请求设置为接收 JSON 响应吗?