|
FRCAPI Objective C JSON/XML Oddity
|
02/18/2016 2:22 AM
post4816
|
FRCAPI Objective C JSON/XML Oddity
I'm trying to use the API in Objective C to fetch JSON data. However, for 2016, it always gives me XML. It I switch the
year to 2015, I get JSON. I tried the same thing in perl and get JSON for both.
Here is a sample
NSURL *URL = [NSURL URLWithString:@"https://frc-api.firstinspires.org/v2.0/2016/events"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setValue:authValue forHTTPHeaderField:@"Authorization"];
[request setHTTPMethod:@"GET"];
[request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request blah, blah, blah completion block
This is returning XML. But the exact same thing with the URL with 2015 as the year:
NSURL *URL = [NSURL URLWithString:@"https://frc-api.firstinspires.org/v2.0/2015/events"];
returns JSON.
I really, real want the JSON as I hate parsing XML.
|
|
|