0
我正在使用AFNetworking共享客戶端向REST服務器發送請求。DELETE請求時,服務器發出錯誤請求
我的刪除代碼是:
NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
[[ApiClient sharedClient] deletePath:[NSString stringWithFormat:@"users/%@/venues/%@/", appDelegate.currentUser.userId, venue.venueId] parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"venue deleted from saved");
} failure:^(AFHTTPRequestOperation *operation, NSError *error){
NSLog(error.description);
}];
當我配置客戶端,我加入:
[self registerHTTPOperationClass:[AFJSONRequestOperation class]];
[self setDefaultHeader:@"Accept" value:@"application/json"];
[self setDefaultHeader:@"Content-Type" value:@"application/json"];
[self setParameterEncoding:AFJSONParameterEncoding];
POST請求工作正常,但與刪除請求的問題。我錯在哪裏?