1. iOS 系统请求
NSString* requestUrlString = kAPI;
NSURL *baseURL = [NSURL URLWithString:[requestUrlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:baseURL];
[request setHTTPMethod:@"POST"];
NSString *postString =@"timestamp=参数1&channel=参数2&product=参数3...";
[request setHTTPBody:[postString dataUsingEncoding:NSUTF8StringEncoding]];
request.timeoutInterval = 30;
NSHTTPURLResponse *response = nil;
NSError *error = nil;
NSData *respData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
2. AF等第三方库
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:@"参数1",timestamp,@"参数2",channel,@"参数3",product,... nil]
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
[manager POST:api parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
//成功处理
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//失败处理
}];