2013-10-20 1 views

ответ

0
AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:@"https://www.url.com/"]]; 
NSDictionary *parameter = @{@"key1":@"value1", @"key2",@"value2"}; 
[httpClient setParameterEncoding:AFJSONParameterEncoding]; 
[httpClient registerHTTPOperationClass:[AFJSONRequestOperation class]]; 

[httpClient postPath:@"some/path" parameters:parameter success:^(AFHTTPRequestOperation *operation, id responseObject) { 

    .... 

} failure:^(AFHTTPRequestOperation *operation, NSError *error) { 

    .... 

}]; 
Смежные вопросы