Created
October 17, 2012 12:02
-
-
Save pita5/3905179 to your computer and use it in GitHub Desktop.
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
| for (int i = 0; i < 100; i++) | |
| { | |
| NSMutableURLRequest* postRequest = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://mastercard.cmdapp.com/Services/Html.asmx/GetHtml"]]; | |
| [postRequest setHTTPMethod:@"POST"]; | |
| [postRequest setHTTPBody:[@"{ moduleID : 1}" dataUsingEncoding:NSUTF8StringEncoding]]; | |
| [postRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; | |
| __autoreleasing NSHTTPURLResponse* response = nil; | |
| NSData* postData = [NSURLConnection sendSynchronousRequest:postRequest | |
| returningResponse:&response | |
| error:nil]; | |
| NSString* postStr = [[NSString alloc] initWithData:postData encoding:NSUTF8StringEncoding]; | |
| NSLog(@"Post data got %d back \n %@", postStr.length, postStr); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment