Friday, October 9, 2026
HomeiOS Developmentios - Getting error message when sending request from Alamofire in swift...

ios – Getting error message when sending request from Alamofire in swift 5 “Sudden quantity in JSON at place 1” , whereas work nice in postman

[ad_1]

I’ve built-in api like this and server return “Sudden quantity in JSON at place 1” error repeatedly , what can I do to repair it ? it’s working nice on postman

    let headers: HTTPHeaders = ["nonce":"(UserDefaults.standard.string(forKey: "nonce")!)","signature":"(signature)","publickey":"(UserDefaults.standard.string(forKey: "publickey")!)","action":"uploadCollectionImage"]
    
    AF.add(multipartFormData: { multiPart in

       let timestamp = NSDate().timeIntervalSince1970
        multiPart.append(imgData, withName: "file",fileName: "new-001",mimeType: "picture/jpeg")
       
    }, to: "https://pri65iunr6.execute-api.us-east-1.amazonaws.com/Prod/uploadArtwork",technique: .submit,headers: headers ).responseJSON { apiResponse in
       
       change apiResponse.end result{
       case .success(_):
           let apiDictionary = apiResponse.worth as? [String:Any]
           print("apiResponse --- (apiDictionary)")
       case .failure(_):
           print("obtained an error")
       }
   }

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments