I'm developing an iOS app using the Square Connect API. I need to connect with the following command:
curl -H "Authorization: Bearer ACCESS_KEY"
https://connect.squareup.com/v1/me/payments
What's the iOS equivalent of this?
I finally figured it out. Posting this here for others to use for referance.
NSString *pswd = @"XXXXXXXXX";
NSURL *url = [NSURL URLWithString:@"https://connect.squareup.com/v1/me/payments"];
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:url];
NSString *authValue = [NSString stringWithFormat:@"Bearer %@", pswd];
[request setValue:authValue forHTTPHeaderField:@"Authorization"];