Quantcast
Viewing all articles
Browse latest Browse all 8068

Request failed: unauthorized (401) error when I try to post to users/external_account_link.json using AFNetworking

Here is the code that is returning "Request failed: unauthorized (401) error":

AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.requestSerializer = [AFHTTPRequestSerializer serializer];
manager.responseSerializer = [AFJSONResponseSerializer serializer];
NSDictionary *parameters = @{@"token": @"12312412421asderfert", @"id": @"123", @"type": @"linkedin"};
[manager POST:@"https://api.cloud.appcelerator.com/v1/users/external_account_link.json?key=dggeagrghehher" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
        NSLog(@"JSON: %@", responseObject);
 
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"Error: %@", error);
    }];
Any idea what I am doing wrong?

Viewing all articles
Browse latest Browse all 8068

Trending Articles