So far I have been doing fine using the code below to upload a profile picture data to the server.
Alamofire.upload(.POST,
URLString: "https://example.com/api/v1/users/profile_pic.json?auth_token=\(auth_token)",
multipartFormData: { multipartFormData in
multipartFormData.appendBodyPart(data: imageData, name: "avatar", fileName: "avatar_img.png", mimeType: "image/png")
},
encodingCompletion: { encodingResult in
switch encodingResult {
case .Success (let upload, _, _):
upload.responseJSON { request, response, data, error in
// Do whatever
}
case .Failure (let encodingError):
}
})
But now I also need to upload my user's other details to the server such as first_name and last_name along with it. How should I do that in one request along with the picture data?