43 lines
1.3 KiB
Objective-C
43 lines
1.3 KiB
Objective-C
#import <Foundation/Foundation.h>
|
||
|
||
NS_ASSUME_NONNULL_BEGIN
|
||
|
||
@class HttpdnsNWReusableConnection;
|
||
|
||
@interface HttpdnsNWHTTPClientResponse : NSObject
|
||
|
||
@property (nonatomic, assign) NSInteger statusCode;
|
||
@property (nonatomic, copy) NSDictionary<NSString *, NSString *> *headers;
|
||
@property (nonatomic, strong) NSData *body;
|
||
|
||
@end
|
||
|
||
@interface HttpdnsNWHTTPClient : NSObject
|
||
|
||
/// 蜈ィ螻蜈ア莠ォ螳樔セ具シ悟、咲畑蠎募アりソ樊磁豎<E7A381><E8B18E>帷コソ遞句ョ牙<EFBDAE>?
|
||
+ (instancetype)sharedInstance;
|
||
|
||
- (nullable HttpdnsNWHTTPClientResponse *)performRequestWithURLString:(NSString *)urlString
|
||
userAgent:(NSString *)userAgent
|
||
timeout:(NSTimeInterval)timeout
|
||
error:(NSError **)error;
|
||
|
||
@end
|
||
|
||
#if DEBUG
|
||
@interface HttpdnsNWHTTPClient (TestInspection)
|
||
|
||
@property (nonatomic, assign, readonly) NSUInteger connectionCreationCount;
|
||
@property (nonatomic, assign, readonly) NSUInteger connectionReuseCount;
|
||
|
||
- (NSUInteger)connectionPoolCountForKey:(NSString *)key;
|
||
- (NSArray<NSString *> *)allConnectionPoolKeys;
|
||
- (NSUInteger)totalConnectionCount;
|
||
- (void)resetPoolStatistics;
|
||
- (NSArray<HttpdnsNWReusableConnection *> *)connectionsInPoolForKey:(NSString *)key;
|
||
|
||
@end
|
||
#endif
|
||
|
||
NS_ASSUME_NONNULL_END
|