AFNetworking 2.5 uploadTaskWithStreamedRequest swift -


i have simple question swift. i'm trying figure out why can't uploading data file using put. in example, self subclasses afhttpsessionmanager.

let request = self.requestserializer.multipartformrequestwithmethod("put",             urlstring: url, parameters: params as! [nsobject : anyobject],             constructingbodywithblock: {(formdata: afmultipartformdata!) in                 if attachmenttype == "image/jpeg" {                     formdata.appendpartwithfiledata(data, name: "image", filename: attachmentname, mimetype: "image/jpeg")                 }             },             error: nil)  let task:nsurlsessionuploadtask  = self.uploadtaskwithstreamedrequest(request, progress: nil, completionhandler: { (response, responseobject, error) in          })  task.resume() 

i can't figure out why it's not uploading, trying log error, it's not compiling, thoughts?

    let task:nsurlsessionuploadtask  = self.uploadtaskwithstreamedrequest(request, progress: nil, completionhandler: { (response, responseobject, error) in         nslog(error)     }) 


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -