From 6b93e5780b5702debe2c2356139137aaec6386e6 Mon Sep 17 00:00:00 2001 From: Aron Balog Date: Mon, 26 Mar 2018 22:39:31 +0200 Subject: [PATCH] Updated docs --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 26d6b9f..2885c18 100644 --- a/README.md +++ b/README.md @@ -334,16 +334,16 @@ Deserializer can also be declared without generic parameter but in that case the #### Client protocol -Implement following method from `Client` protocol - userInfo contains custom data you can pass to the client to do some internal logic: e.g. add some extra headers, add encryption etc.: +Implement following method from `Client` protocol: ```swift -func executeRequest(userInfo: [String: Any], - path: String, +func executeRequest(path: String, method: String, queryItems: [URLQueryItem], bodyParameters: [String : Any]?, success: @escaping ClientSuccessBlock, - failure: @escaping ClientFailureBlock) + failure: @escaping ClientFailureBlock, + userInfo: [String: Any]) ``` where @@ -351,6 +351,10 @@ where - `ClientSuccessBlock` = `(HTTPURLResponse?, Data?) -> Void` - `ClientFailureBlock` = `(Error?, Data?) -> Void` +Note: + +`userInfo` contains custom data you can pass to the client to do some custom logic: e.g. add some extra headers, add encryption etc. + #### Alamofire client plugin If custom networking is not required, there is a plugin which wraps [Alamofire](https://github.com/Alamofire/Alamofire) and provides networking client in accordance with JSON:API specification. @@ -404,7 +408,7 @@ dataSource ```swift let dataSource = DataSource(strategy: .path("custom-path/"), client: client) -Person.dataSource(url: url) +dataSource(url: url) .fetch() .include([ "favoriteArticle"