Networking
public protocol Networking
Basic networking protocol
-
Sends a request to the server and the response can be subscribed to
Declaration
Swift
func response(for request: URLRequest) -> Observable<(response: HTTPURLResponse, data: Data?)>Parameters
requestrequest sent to server
sessionsession used for communication
Return Value
An Observable of the
HTTPURLResponseandDataif there is any -
Sends a request to the server and the response data can be subscribed to
Declaration
Swift
func data(for request: URLRequest) -> Observable<Data>Parameters
requestrequest sent to server
sessionsession used for communication
Return Value
An Observable of the
Dataif there is any -
Sends a request to the server and the response data are transformed into object of type
Tand it can be subscribed toDeclaration
Swift
func object<T>(for request: URLRequest) -> Observable<T> where T : Decodable, T : EncodableParameters
requestrequest sent to server
sessionsession used for communication
Return Value
An Observable of
T -
Sends a request to the server and the response data in JSON format can be subscribed to
Declaration
Swift
func json(for request: URLRequest) -> Observable<JSONDictionary>Parameters
requestrequest sent to server
Return Value
An Observable of the
JSONDictionary
Networking Protocol Reference