Firstly, I want to say that I am new to speed, and I know a little. So any help will be assigned. I have a multi-page data form in which there is an image (profile-image), several parameters (name, surname) and headers (userid, hashCode). I want to send a POST request to submit a form.
I was able to make a POST request only with headers and other parameters, except as:
let headers = [ "user_id": (Helper.getUserInfo()?.user_id)!, "hash_code":(Helper.getUserInfo()?.hash_code)!, ] let params = [ "name": self.name.text!, "address":self.address.text!] Alamofire.request(.POST, kFormUrl, parameters:params ,headers:headers).responseJSON { [weak self] response in
But how to send an image as a file (and not base-64string), that is, directly upload a file with parameters and headers.
Thanks in advance
ios swift alamofire
ashwin shrestha
source share