Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- curl -H 'Authorization: Token token="replace-with-token"' http://domain.com/books
- NSURL *url = [NSURL URLWithString:@"http://domain.com/books"];
- config = [NSURLSessionConfiguration defaultSessionConfiguration];
- [config setHTTPAdditionalHeaders:@{@"token":@"4959a0bc00a15e335fb6"}];
- NSURLSession *session = [NSURLSession sessionWithConfiguration:config];
- [[session dataTaskWithURL:url completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
- NSLog(@"%@", [NSJSONSerialization JSONObjectWithData:data options:0 error:nil]);
- }] resume];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement