SHARE
TWEET

Untitled

a guest Jun 20th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. imagesArray.indices.forEach {
  2.             multipartFormData.append(imagesArray[$0].jpegData(compressionQuality:0.6)!, withName: "photo[($0)]", fileName: "photo($0).jpeg", mimeType: "image/jpeg")
  3.  
  4.         }
  5.         for (key, value) in parameters {
  6.             print("value = (value)")
  7.             print("parameter = (parameters)")
  8.             multipartFormData.append((value as AnyObject).data(using: String.Encoding.utf8.rawValue)!, withName: key)
  9.         }
  10.         print(multipartFormData)
  11.     }, to: storeCentreImageURL, method: .post) { (result) in
  12.  
  13.         switch result {
  14.         case .success(let upload, _ , _):
  15.             upload
  16.                 .validate()
  17.                 .responseJSON { response in
  18.                     switch response.result {
  19.                     case .success(let value):
  20.  
  21.                         print("responseObject: (value)")
  22.                     case .failure(let responseError):
  23.                         print("responseError: (responseError)")
  24.                     }
  25.             }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top