RLMNetworkTransport
Objective-C
@protocol RLMNetworkTransport <NSObject>
Swift
protocol RLMNetworkTransportProtocol : NSObjectProtocol
Transporting protocol for foreign interfaces. Allows for custom request/response handling.
-
Sends a request to a given endpoint.
Declaration
Objective-C
- (void)sendRequestToServer:(nonnull RLMRequest *)request completion:(nonnull RLMNetworkTransportCompletionBlock) completionBlock;
Swift
func sendRequest(toServer request: RLMRequest) async -> RLMResponse
Parameters
request
The request to send.
completionBlock
A callback invoked on completion of the request.
-
Starts an event stream request.
Declaration
Objective-C
- (nonnull NSURLSession *)doStreamRequest:(nonnull RLMRequest *)request eventSubscriber: (nonnull id<RLMEventDelegate>)subscriber;
Swift
func doStreamRequest(_ request: RLMRequest, eventSubscriber subscriber: any RLMEventDelegate) -> URLSession
Parameters
request
The RLMRequest to start.
subscriber
The RLMEventDelegate which will subscribe to changes from the server.