@@ -16,6 +16,21 @@ public extension Networking {
1616 return handleJSONRequest ( . get, path: path, cacheName: nil , parameterType: parameterType, parameters: parameters, responseType: . json, cachingLevel: cachingLevel, completion: completion)
1717 }
1818
19+ /// GET request to the specified path, allowing overridden parameter types
20+ ///
21+ /// Overridden parameter types can be useful, for example some REST-ful APIs do not strictly adhere to spec.
22+ ///
23+ /// - Parameters:
24+ /// - path: The path for the GET request.
25+ /// - parameterType: The parameters type to be used.
26+ /// - parameters: The parameters to be used, they will be serialized using Percent-encoding and appended to the URL.
27+ /// - completion: The result of the operation, it's an enum with two cases: success and failure.
28+ /// - Returns: The request identifier.
29+ @discardableResult
30+ func get( _ path: String , parameterType: ParameterType , parameters: Any ? = nil , completion: @escaping ( _ result: JSONResult ) -> Void ) -> String {
31+ handleJSONRequest ( . get, path: path, cacheName: nil , parameterType: parameterType, parameters: parameters, responseType: . json, cachingLevel: . none, completion: completion)
32+ }
33+
1934 /// Registers a fake GET request for the specified path. After registering this, every GET request to the path, will return the registered response.
2035 ///
2136 /// - Parameters:
@@ -205,6 +220,21 @@ public extension Networking {
205220 return handleJSONRequest ( . delete, path: path, cacheName: nil , parameterType: parameterType, parameters: parameters, responseType: . json, cachingLevel: . none, completion: completion)
206221 }
207222
223+ /// DELETE request to the specified path, allowing overridden parameter types
224+ ///
225+ /// Overridden parameter types can be useful, for example some REST-ful APIs do not strictly adhere to spec.
226+ ///
227+ /// - Parameters:
228+ /// - path: The path for the DELETE request.
229+ /// - parameterType: The parameters type to be used.
230+ /// - parameters: The parameters to be used, they will be serialized using Percent-encoding and appended to the URL.
231+ /// - completion: The result of the operation, it's an enum with two cases: success and failure.
232+ /// - Returns: The request identifier.
233+ @discardableResult
234+ func delete( _ path: String , parameterType: ParameterType , parameters: Any ? = nil , completion: @escaping ( _ result: JSONResult ) -> Void ) -> String {
235+ handleJSONRequest ( . delete, path: path, cacheName: nil , parameterType: parameterType, parameters: parameters, responseType: . json, cachingLevel: . none, completion: completion)
236+ }
237+
208238 /// Registers a fake DELETE request for the specified path. After registering this, every DELETE request to the path, will return the registered response.
209239 ///
210240 /// - Parameters:
0 commit comments