Questions tagged as 'alamofire'

2
answers

Conversion from the project's Alamofire to swift 3.0

I have the following code when I want to make a call to the server: let mutableURLRequest = NSMutableURLRequest(url: URL) mutableURLRequest.httpMethod = "POST" let parameters = ["SessionID": sessionID] do { mutableURLRequest....
asked by 10.10.2016 / 18:48
1
answer

Uploading image to webservice

I'm using alamofire to do post to server, I wanted to know how to send an object that has an img inside it. I saw the following excerpt to upload the image let fileURL = NSBundle.mainBundle().URLForResource("Default", withExtension: "png"...
asked by 04.08.2016 / 01:34
1
answer

Alamofire 3 how to get errors if there is a service call (Swift2)

I have the following code to call the server Alamofire.request(mutableURLRequest) .responseJSON{ request, response, result in response in if let value: AnyObject = response.result.value {...
asked by 17.02.2016 / 12:00
1
answer

How to pass to Array JSON information in Swift

When the result comes from the server I use the following code snippet to get the result: if let JSON = response.result.value { print("JSON: \(JSON)") } And the print result is: [{ Nome = Tiago; Idade = 22; Cidade = Minas; },...
asked by 12.02.2016 / 16:23
1
answer

How to pass a value from a dictionary (which is inside another dictionary) to a Label? Swift 3 [closed]

I have a database something like this: { "status": "OK", "data": [ { "id": 1, "name": "Mike", "informations": [ { "id": 474, "text": "My son", "reference": "www.google.com",...
asked by 31.01.2017 / 01:30
1
answer

How to load an Image into a UITableView?

I made a request that returned some texts and some urls with images, these images I need to load them along with the text in parallel in the table. I am using Alamofire + AlamofireImage to load the texts / Images, my doubt and the following,...
asked by 01.02.2016 / 22:46
0
answers

Change downloaded file name using Alamofire

I'm developing an iOS app where I update by downloading the JSON file with the new data, this file generated by PHP let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory) Alamofire.download(MINHA_URL.PHP, to:...
asked by 03.01.2017 / 01:27
1
answer

Request Post in webservice with swift

I'm now starting to use alamofire, I was able to quietly make requests .get however I crashed the post request. I created a user class that has name, email and password, however I can not post a user stay object let usuario = Usuario()...
asked by 02.08.2016 / 23:49
3
answers

How to handle a reponse.result.value that returns as optional log ([])?

I am in the following situation I have a request in Alamofire that returns me a json that may have data or not (usually has but might not). I want to handle when the response.result.value returns optional ([]). I tried this but it did not wor...
asked by 05.04.2018 / 14:56
1
answer

swift - Send json body by alamofire

I'm on my first project in Swift, and I need to send a RequestBody to POST through Alamofire. This is an example of JSON that I need to send: { "user":{ "email":"[email protected]" } } And I have my Class User . fun...
asked by 14.09.2017 / 16:47