Commit 716d034e authored by Mauro E. Bender's avatar Mauro E. Bender

Close #9 - Add PUT, PATCH and DELETE methods to the API

parent 981e1391
......@@ -49,6 +49,27 @@ public class Api {
headers: headers, completion: completion)
}
public func put( path: String, parameters: [String: AnyObject]? = nil, encoding: ParameterEncoding = .URL,
headers: [String: String]? = nil, completion: Response<AnyObject, NSError> -> Void )
{
return request( .PUT, path: path, parameters: parameters, encoding: encoding,
headers: headers, completion: completion)
}
public func patch( path: String, parameters: [String: AnyObject]? = nil, encoding: ParameterEncoding = .URL,
headers: [String: String]? = nil, completion: Response<AnyObject, NSError> -> Void )
{
return request( .PATCH, path: path, parameters: parameters, encoding: encoding,
headers: headers, completion: completion)
}
public func delete( path: String, parameters: [String: AnyObject]? = nil, encoding: ParameterEncoding = .URL,
headers: [String: String]? = nil, completion: Response<AnyObject, NSError> -> Void )
{
return request( .DELETE, path: path, parameters: parameters, encoding: encoding,
headers: headers, completion: completion)
}
func urlForPath( path: String ) -> NSURL {
return apiURL.URLByAppendingPathComponent( path )
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment