Class: AFHTTPSessionManager
- Inherits:
-
Object
- Object
- AFHTTPSessionManager
- Includes:
- AFMotion::ClientShared
- Defined in:
- lib/afmotion/session_client.rb
Instance Method Summary collapse
-
#PUT(url_string, options = {}) ⇒ Object
options = , constructingBodyWithBlock: , success:, failure:.
Methods included from AFMotion::ClientShared
#all_headers, #authorization=, #create_multipart_operation, #create_operation, #headers, #multipart_post, #multipart_put
Instance Method Details
#PUT(url_string, options = {}) ⇒ Object
options = , constructingBodyWithBlock: , success:, failure:
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/afmotion/session_client.rb', line 130 def PUT(url_string, = {}) parameters = [:parameters] block = [:constructingBodyWithBlock] success = [:success] failure = [:failure] request = self.requestSerializer.multipartFormRequestWithMethod("PUT", URLString: NSURL.URLWithString(url_string, relativeToURL: self.baseURL).absoluteString, parameters:parameters, constructingBodyWithBlock:block) task = self.dataTaskWithRequest(request, completionHandler: ->(response, responseObject, error) { if error && failure failure.call(task, error) elsif success success.call(task, responseObject) end }) task.resume task end |