2016-09-15 33 views

回答

0

您可以按照這種方式, whereyour網址都是獨立的,參數由NSMutableURLRequest發送,然後使用NSURLSession張貼到服務器 將在[request setHTTPBody:postData];

NSURL *url = [NSURL URLWithString:strUrl]; 

NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; 
[request setURL:url]; 
[request setHTTPMethod:httpMehod]; 
[request setValue:postLength forHTTPHeaderField:@"Content-Length"]; 
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; 
[request setHTTPBody:postData]; 
相關問題