Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://api.stripe.com/v1/recipients"]];
- [request setValue:[NSString stringWithFormat:@"Bearer %@",StripeSecretKey] forHTTPHeaderField:@"Authorization"];
- NSString *params = [NSString stringWithFormat:@"name=JohnDoe&type=individual"];
- request.HTTPMethod = @"POST";
- request.HTTPBody = [params dataUsingEncoding:NSUTF8StringEncoding];
- [NSURLConnection sendAsynchronousRequest:request
- queue:[NSOperationQueue mainQueue]
- completionHandler:^(NSURLResponse *response, NSData *data, NSError *error)
- {
- if (error)
- {
- NSLog(@"ERROR: %@",error.userInfo);
- }
- else
- {
- NSLog(@"data: %@", data);
- NSLog(@"data: %@", [[NSString alloc] initWithData:data encoding: NSUTF8StringEncoding]);
- }
- }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement