Class: AFHTTPSessionManager
- Inherits:
-
Object
- Object
- AFHTTPSessionManager
- Includes:
- AFMotion::ClientShared, AFMotion::Serialization
- Defined in:
- lib/afmotion/ext/AFHTTPSessionManager.rb
Instance Method Summary collapse
-
#PUT(url_string, options = {}) ⇒ Object
options = , constructingBodyWithBlock: , success:, failure:.
Methods included from AFMotion::ClientShared
#all_headers, #authorization=, #create_multipart_task, #create_task, #failure_block, #headers, #multipart_post, #multipart_put, #success_block_for_http_method
Methods included from AFMotion::Serialization
#http!, #image!, #json!, #plist!, #with_request_serializer, #with_response_serializer, #xml!
Instance Method Details
#PUT(url_string, options = {}) ⇒ Object
options = , constructingBodyWithBlock: , success:, failure:
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/afmotion/ext/AFHTTPSessionManager.rb', line 52 def PUT(url_string, = {}) parameters = [:parameters] block = [:constructingBodyWithBlock] progress = [:progress_block] success = [:success] failure = [:failure] request = self.requestSerializer.multipartFormRequestWithMethod("PUT", URLString: NSURL.URLWithString(url_string, relativeToURL: self.baseURL).absoluteString, parameters:parameters, constructingBodyWithBlock:block, error:nil) task = self.dataTaskWithRequest(request, uploadProgress: progress, downloadProgress: nil, completionHandler: ->(response, responseObject, error) { if error && failure failure.call(task, error) elsif success success.call(task, responseObject) end }) task.resume task end |