0
我想連接到一個Api,但它使用的是x-www-form-urlencoded ...並且我使用了這個代碼.Plz告訴我正確的方法x-www-form-urlencoded objective c
AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
securityPolicy.allowInvalidCertificates = YES;
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.responseSerializer.acceptableContentTypes = nil;
manager.securityPolicy = securityPolicy;
[manager POST:[NSString stringWithFormat:@"@"%@%@phone=%@&password=%@",BASE_URL,API_LOGIN,phone,password]
parameters:nil
success:^(AFHTTPRequestOperation *operation, id responseObject) {
successBlock(responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Server Error : %@", operation.responseString);
errorBlock(error);
}];
}
這是什麼問題? – shallowThought