这是我的代码:
NSURL *url = [NSURL URLWithString:@"http://wspublisherv2.skygiraffe.com/WSpublisherV2.svc/Authenticate"];
AFHTTPClient *client = [[AFHTTPClient alloc]initWithBaseURL:url];
NSDictionary *parameters = [NSDictionary dictionaryWithObjectsAndKeys:@"john@sgdemo.com", @"UserName", @"123", @"Password", nil];
NSLog(@"%@", parameters);
[client postPath:nil parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"success: %@", responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"failure: %@", error);
}];
它总是触发故障块,我收到“(200-299)中的预期状态代码,得到404”消息。
当我通过 Fiddler 尝试它时,它可以工作。