This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)sendPOSTRequestWithURL:(NSURL *)url parameters:(NSDictionary *)parameters completionHandler:(void (^)(NSData *, NSURLResponse *, NSError *))completionHandler { | |
| // Create a mutable URL request | |
| NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; | |
| // Set the request method to POST | |
| [request setHTTPMethod:@"POST"]; | |
| // Set the request body with the parameters | |
| NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil]; | |
| [request setHTTPBody:postData]; |
OlderNewer