Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,28 @@
#import <React/RCTInvalidating.h>
#import <React/RCTURLRequestHandler.h>

NS_ASSUME_NONNULL_BEGIN

typedef NSURLSessionConfiguration *_Nullable (^NSURLSessionConfigurationProvider)(void);
/**
* The block provided via this function will provide the NSURLSessionConfiguration for all HTTP requests made by the
* app.
*/
RCT_EXTERN void RCTSetCustomNSURLSessionConfigurationProvider(NSURLSessionConfigurationProvider /*provider*/);
RCT_EXTERN void RCTSetCustomNSURLSessionConfigurationProvider(NSURLSessionConfigurationProvider _Nullable /*provider*/);

typedef NSURLRequest *_Nullable (^RCTHTTPRequestInterceptor)(NSURLRequest *request);
/**
* The block provided via this function can inspect/modify HTTP requests before
* they are sent. Return a modified request to override, or nil to use the
* original request unchanged.
*/
RCT_EXTERN void RCTSetCustomHTTPRequestInterceptor(RCTHTTPRequestInterceptor /*interceptor*/);
RCT_EXTERN void RCTSetCustomHTTPRequestInterceptor(RCTHTTPRequestInterceptor _Nullable /*interceptor*/);

/**
* This is the default RCTURLRequestHandler implementation for HTTP requests.
*/
@interface RCTHTTPRequestHandler : NSObject <RCTURLRequestHandler, RCTInvalidating>

@end

NS_ASSUME_NONNULL_END
15 changes: 10 additions & 5 deletions packages/react-native/React/Base/RCTMultipartDataTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
#import <React/RCTDefines.h>
#import <React/RCTMultipartStreamReader.h>

NS_ASSUME_NONNULL_BEGIN

typedef void (^RCTMultipartDataTaskCallback)(
NSInteger statusCode,
NSDictionary *headers,
NSData *content,
NSError *error,
NSDictionary *_Nullable headers,
NSData *_Nullable content,
NSError *_Nullable error,
BOOL done);

typedef NSURLRequest *_Nullable (^RCTMultipartDataTaskRequestInterceptor)(NSURLRequest *request);
Expand All @@ -23,14 +25,17 @@ typedef NSURLRequest *_Nullable (^RCTMultipartDataTaskRequestInterceptor)(NSURLR
* requests before they are sent. Return a modified request to override, or nil
* to use the original request unchanged.
*/
RCT_EXTERN void RCTSetCustomMultipartDataTaskRequestInterceptor(RCTMultipartDataTaskRequestInterceptor /*interceptor*/);
RCT_EXTERN void RCTSetCustomMultipartDataTaskRequestInterceptor(
RCTMultipartDataTaskRequestInterceptor _Nullable /*interceptor*/);

@interface RCTMultipartDataTask : NSObject

- (instancetype)initWithURL:(NSURL *)url
partHandler:(RCTMultipartDataTaskCallback)partHandler
progressHandler:(RCTMultipartProgressCallback)progressHandler;
progressHandler:(nullable RCTMultipartProgressCallback)progressHandler;

- (void)startTask;

@end

NS_ASSUME_NONNULL_END
Loading