有没有人用过yahoo汇率api,AFNetworking解析错误,在线求助!!!
代码:
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/plain", nil];
[manager GET:@"http://download.finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s=USDUSD=x+USDCNY=x+USDHKD=x+USDJPY=x+USDTHB=x+USDEUR=x+USDGBP=x> parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject)
{
NSLog(@"JSON: %@", responseObject);
}
failure:^(AFHTTPRequestOperation *operation, NSError *error)
{
NSLog(@"failed:%@",error);
}];
报错:Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (JSON text did not start with array or object and option to allow fragments not set.) UserInfo=0x8d8e510 {NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}