1
我使用Google融合表的ios應用程序。在previous question我得到了建議並取得了進展,但仍然在創建融合表。我的代碼:從iOS創建Fusion表
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];
但是我得到錯誤:「操作無法完成(com.google.HTTPStatus錯誤400)」。我究竟做錯了什麼?
是做到了,謝謝! – asaki