谷歌日历api事件PATCH请求

时间:2014-09-10 10:16:40

标签: objective-c api ios7 xcode5 google-calendar-api

我正在尝试使用方法

保存日历事件中的更改
- (void)updateEventWithCalendarID:(NSString *)calendarID andEventID:(NSString *)eventID description:(NSString *)descript { //update description

    NSString *urlString = [NSString stringWithFormat:@"https://www.googleapis.com/calendar/v3/calendars/%@/events/%@?key=%@",calendarID, eventID, API_KEY];
    NSDictionary *params = @{@"description" : descript};

    [self.requestOperationManager.requestSerializer setValue:[@"Bearer "stringByAppendingString:self.accessToken.token] forHTTPHeaderField:@"Authorization"];
    NSLog(@"%@", [@"Bearer "stringByAppendingString:self.accessToken.token]);
    [self.requestOperationManager PATCH:urlString
                             parameters:params
                                success:^(AFHTTPRequestOperation *operation, id responseObject) {
                                    NSLog(@"%@", responseObject);
                                }
                                failure:^(AFHTTPRequestOperation *operation, NSError *error) {
                                    NSLog(@"ERROR: %@", [error localizedDescription]);
                                }];
}

但始终有ERROR:请求失败:禁止(403)或错误(401) 我做错了什么,任何人都可以帮助我吗?

0 个答案:

没有答案