|
@@ -23,6 +23,11 @@
|
23
|
23
|
|
24
|
24
|
typedef void(^CompletionHander)(NSURL * _Nullable location, NSURLResponse * _Nullable response, NSError * _Nullable error);
|
25
|
25
|
typedef void(^DataTaskCompletionHander) (NSData * _Nullable resp, NSURLResponse * _Nullable response, NSError * _Nullable error);
|
|
26
|
+typedef NS_ENUM(NSUInteger, ResponseFormat) {
|
|
27
|
+ UTF8,
|
|
28
|
+ BASE64,
|
|
29
|
+ AUTO
|
|
30
|
+};
|
26
|
31
|
|
27
|
32
|
@interface RNFetchBlobNetwork : NSObject <NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDataDelegate>
|
28
|
33
|
|
|
@@ -38,6 +43,19 @@ typedef void(^DataTaskCompletionHander) (NSData * _Nullable resp, NSURLResponse
|
38
|
43
|
@property (strong, nonatomic) CompletionHander fileTaskCompletionHandler;
|
39
|
44
|
@property (strong, nonatomic) DataTaskCompletionHander dataTaskCompletionHandler;
|
40
|
45
|
@property (nullable, nonatomic) NSError * error;
|
|
46
|
+@property (nullable, nonatomic) NSMutableArray * redirects;
|
|
47
|
+
|
|
48
|
+@property (nonatomic) BOOL respFile;
|
|
49
|
+@property (nonatomic) BOOL isNewPart;
|
|
50
|
+@property (nonatomic) BOOL isIncrement;
|
|
51
|
+@property (nullable, nonatomic) NSMutableData * partBuffer;
|
|
52
|
+@property (nullable, nonatomic) NSString * destPath;
|
|
53
|
+@property (nullable, nonatomic) NSOutputStream * writeStream;
|
|
54
|
+@property (nonatomic) long bodyLength;
|
|
55
|
+@property (nullable, nonatomic) NSMutableDictionary * respInfo;
|
|
56
|
+@property (nonatomic) NSInteger respStatus;
|
|
57
|
+@property (nonatomic) ResponseFormat responseFormat;
|
|
58
|
+@property ( nonatomic) BOOL followRedirect;
|
41
|
59
|
|
42
|
60
|
|
43
|
61
|
+ (NSMutableDictionary * _Nullable ) normalizeHeaders:(NSDictionary * _Nullable)headers;
|