commit | author | age
|
454098
|
1 |
/* |
L |
2 |
* Copyright 2020 Google LLC |
|
3 |
* |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
*/ |
|
16 |
|
|
17 |
#import <Foundation/Foundation.h> |
|
18 |
|
|
19 |
@class FBLPromise<Value>; |
|
20 |
@class GULURLSessionDataResponse; |
|
21 |
|
|
22 |
NS_ASSUME_NONNULL_BEGIN |
|
23 |
|
|
24 |
/** Promise based API for `NSURLSession`. */ |
|
25 |
@interface NSURLSession (GULPromises) |
|
26 |
|
|
27 |
/** Creates a promise wrapping `-[NSURLSession dataTaskWithRequest:completionHandler:]` method. |
|
28 |
* @param URLRequest The request to create a data task with. |
|
29 |
* @return A promise that is fulfilled when an HTTP response is received (with any response code), |
|
30 |
* or is rejected with the error passed to the task completion. |
|
31 |
*/ |
|
32 |
- (FBLPromise<GULURLSessionDataResponse *> *)gul_dataTaskPromiseWithRequest: |
|
33 |
(NSURLRequest *)URLRequest; |
|
34 |
|
|
35 |
@end |
|
36 |
|
|
37 |
NS_ASSUME_NONNULL_END |