This repository was archived by the owner on Jan 17, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,17 +28,18 @@ AFOAuth2Manager *OAuth2Manager =
2828### Authorizing Requests
2929
3030```objective-c
31- AFHTTPRequestOperationManager *manager =
32- [[AFHTTPRequestOperationManager alloc] initWithBaseURL:baseURL];
31+ AFHTTPSessionManager *manager =
32+ [[AFHTTPSessionManager alloc] initWithBaseURL:baseURL];
3333
3434[manager.requestSerializer setAuthorizationHeaderFieldWithCredential:credential];
3535
3636[manager GET:@"/path/to/protected/resource"
3737 parameters:nil
38- success:^(AFHTTPRequestOperation *operation, id responseObject) {
38+ progress:nil
39+ success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
3940 NSLog(@"Success: %@", responseObject);
4041 }
41- failure:^(AFHTTPRequestOperation *operation , NSError *error) {
42+ failure:^(NSURLSessionDataTask * _Nullable task , NSError * _Nonnull error) {
4243 NSLog(@"Failure: %@", error);
4344 }];
4445```
@@ -61,13 +62,6 @@ AFOAuthCredential *credential =
6162
6263Documentation for all releases of AFOAuth2Manager are [ available on CocoaDocs] ( http://cocoadocs.org/docsets/AFOAuth2Manager/ ) .
6364
64- ## Contact
65-
66- Mattt Thompson
67-
68- - http://github.com/mattt
69- - http://twitter.com/mattt
70- - m@mattt.me
7165
7266## License
7367
Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ - (void)testUserCredentialsSucceedsWithNoBasicAuthentication {
6868 }];
6969
7070 [self waitForExpectationsWithTimeout: 10.0 handler: nil ];
71+
72+ [manager invalidateSessionCancelingTasks: YES ];
7173}
7274
7375@end
You can’t perform that action at this time.
0 commit comments