Append data to a POST NSURLRequest
问题 How do you append data to an existing POST NSURLRequest ? I need to add a new parameter userId=2323 . 回答1: If you don't wish to use 3rd party classes then the following is how you set the post body... NSURL *aUrl = [NSURL URLWithString:@"http://www.apple.com/"]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:aUrl cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; [request setHTTPMethod:@"POST"]; NSString *postString = @"company=Locassa&quality=AWESOME!";