commit | author | age
|
655e66
|
1 |
/* |
H |
2 |
* Copyright (C) 2017 Twitter, Inc. |
|
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 |
|
|
18 |
#import <Foundation/Foundation.h> |
|
19 |
@class TWTRAuthConfig; |
|
20 |
/** |
|
21 |
* Completion block called when the network request succeeds or fails. |
|
22 |
* |
|
23 |
* @param response Metadata associated with the response to a URL load request. |
|
24 |
* @param data Content data of the response. |
|
25 |
* @param connectionError Error object describing the network error that occurred. |
|
26 |
*/ |
|
27 |
typedef void (^TWTRTwitterNetworkCompletion)(NSURLResponse *response, NSData *data, NSError *connectionError); |
|
28 |
|
7be7ad
|
29 |
@interface TwitterNetworking : NSObject |
655e66
|
30 |
|
H |
31 |
@property (nonatomic, readonly) TWTRAuthConfig *authConfig; |
|
32 |
|
7be7ad
|
33 |
- (instancetype)init __unavailable; |
655e66
|
34 |
- (instancetype)initWithAuthConfig:(TWTRAuthConfig *)authConfig; |
H |
35 |
|
7be7ad
|
36 |
- (NSURLRequest *)GET:(NSString *)URLString parameters:(NSDictionary *)parameters; |
H |
37 |
- (NSURLRequest *)POST:(NSString *)URLString parameters:(NSDictionary *)parameters; |
|
38 |
- (NSURLRequest *)DELETE:(NSString *)URLString parameters:(NSDictionary *)parameters; |
655e66
|
39 |
|
7be7ad
|
40 |
- (NSURLRequest *)URLRequestWithMethod:(NSString *)method URL:(NSString *)URLString parameters:(NSDictionary *)parameters; |
655e66
|
41 |
|
H |
42 |
- (void)sendAsynchronousRequest:(NSURLRequest *)request completion:(TWTRTwitterNetworkCompletion)completion; |
|
43 |
|
|
44 |
@end |