Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Plain Text by 123 ( 11 years ago )
-(void)getFirmsName:(NSString *)token country:(NSString *)country completion:(CompletionBlock)completitionBlock {

    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    AFJSONRequestSerializer *requestSerializer = [AFJSONRequestSerializer serializer];
    [requestSerializer setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
    manager.requestSerializer = requestSerializer;
     manager.resp serializer];
    
    NSDictionary *params = @{ @"token" : @"8c44e9cf94a774962de2b4e34ae326b9",
                              @"content" : @{@"country":@"US"} };

    [manager POST:@"http://masuma.ru/api-test/selectionbycar?"
      parameters:params
         success:^(AFHTTPRequestOperation *operation, id responseObject) {
              NSArray *js JSONObjectWithData:responseObject options:0 error:nil];
             completitionBlock (YES, jsonDict);
     
     }
         failure:^(AFHTTPRequestOperation *operation, NSError *error) {
              NSLog (@"error %@", error);
             completitionBlock (NO, error.localizedDescription);
         }];
}

 

Revise this Paste

Your Name: Code Language: