I work on ios application that use Google fusion tables. in previous question I got advice and made progress but still struggle with creating fusion table. my code:
NSString *url = @"https://www.googleapis.com/fusiontables/v1/tables";
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:myTableDict options:NSJSONWritingPrettyPrinted error:nil];
NSString *jsonDataString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSData *postData = [jsonDataString dataUsingEncoding:NSUTF8StringEncoding];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]];
GTMHTTPFetcher *fetcher = [GTMHTTPFetcher fetcherWithRequest:request];
[fetcher setAuthorizer:self.auth];
[fetcher setPostData:postData];
void(^createHandler)(NSData *data, NSError *error) = ^(NSData *data, NSError *error){
if (error) {
NSLog(@"error creating table %@", [error localizedDescription]);
}
};
[fetcher beginFetchWithCompletionHandler:createHandler];
But I am getting error: "The operation couldn’t be completed. (com.google.HTTPStatus error 400.)". what am I doing wrong?