Questions tagged [alamofire]

Alamofire is an HTTP networking library written in Swift.

Alamofire is an HTTP networking library written in Swift.

Features

  • Chainable Request / Response Methods
  • URL / JSON / plist Parameter Encoding
  • Upload File / Data / Stream / MultipartFormData
  • Download File using Request or Resume Data
  • Authentication with URLCredential
  • HTTP Response Validation
  • Upload and Download Progress Closures with Progress
  • cURL Command Output
  • Dynamically Adapt and Retry Requests
  • TLS Certificate and Public Key Pinning
  • Network Reachability
  • Comprehensive Unit and Integration Test Coverage

Project

6065 questions
10
votes
2 answers

Alamofire 4 Swift 3 ParameterEncoding Custom

I updated my project to Swift 3 and Alamofire 4. I was using custom Encoding, but it's changed to other encoding methods. I am not able to find the alternative/equivalent to this: alamoFire.request(urlString, method: HTTPMethod.post, parameters:…
Raheel Sadiq
  • 9,847
  • 6
  • 42
  • 54
10
votes
2 answers

collection view cells not loading images correctly

I'm developing an iOS application that loads posts from a server into a UICollectionView. The collection view cell includes a UIImageView that is fixed to the bottom of the cell. Whenever I start the application and the collection view loads, all…
Danoram
  • 8,132
  • 12
  • 51
  • 71
10
votes
1 answer

Using disk cached images if present in Alamofire Images

I'm using the AlamofireImage library to cache downloaded images. Code: import UIKit import AlamofireImage class ViewController: UIViewController { @IBOutlet weak var firstImageView: UIImageView! @IBOutlet weak var secondImageView:…
Javier Cadiz
  • 12,326
  • 11
  • 55
  • 76
10
votes
1 answer

Setting Alamofire custom destination file name instead of using suggestedDownloadDestination

I got many lists of invoice file at my table view as well as many download buttons at each cell.When I clicked one of it,it will download the invoice file.But,the problem is the server response suggested file name is "invoice.pdf" at every file I…
Thiha Aung
  • 5,036
  • 8
  • 36
  • 79
10
votes
1 answer

Multiple calls to a Alamofire request, get reference for each call

I have used Alamofire for uploading images in multipart form data. I am successful in achieving my target. Each time I upload an image, I call the "uploadDocWebService" function. So the number of times the function is called, is equal to the number…
Amrit Sidhu
  • 1,870
  • 1
  • 18
  • 32
10
votes
2 answers

Saving cookies in Alamofire (Swift)

I want to store my cookies so that when i reopen the application i can restore the ones stored in the previous instance. To initialize alamofire i use: let manager = Alamofire.Manager.sharedInstance And my code to load cookies is: let cookies =…
Zac
  • 423
  • 1
  • 6
  • 18
10
votes
1 answer

Could Not Connect to Local Server in Xcode

Trying to Connect to a local server from Xcode. I have imported an Alamofire Pod into my Xcode project and run the following command in xcode Alamofire.request(.GET, "http://localhost:3000" , parameters: ["code": "123"]).responseJSON { …
cnichs27
  • 248
  • 3
  • 17
10
votes
4 answers

Get server response message from error

My server (CakePHP) is responding like so: $this->response->statusCode('400'); $this->response->type('json'); $this->response->body(json_encode(array('message' => 'Bookmark already exists'))); The Postman output looks like what you would…
tompa
  • 101
  • 1
  • 2
  • 4
10
votes
2 answers

Alamofire Request error: NSURLErrorDomain Code -1005 The network connection was lost

I'm working on transferring my project from AFNetworking to Alamofire. Really like the project. However, I'm receiving this error when attempting to make a GET request. Here's some example code: class func listCloudCredntials(onlyNew onlyNew: Bool =…
Cody Winton
  • 2,989
  • 5
  • 25
  • 48
10
votes
4 answers

Alamofire always give me error with status code 500 in response

I'm facing the following problem, I'm trying to use Alamofire to access to a few Web services in my application, this is the code that i'm using: Alamofire.request(.GET, "https://httpbin.org/get") .validate() .responseJSON { response…
Jose Raul Perera
  • 778
  • 1
  • 7
  • 35
10
votes
0 answers

Does Alamofire support NSOperation queue?

I want to implement a batch of request using alamofire. I want to use NSOperation queue to manage it. Is it supported using Alamofire framework.
kalim sayyad
  • 1,076
  • 1
  • 9
  • 13
10
votes
3 answers

Async download inside didReceiveRemoteNotification

My app is configured to support silent push (content-available), and also supports background fetch. Want I need to achieve is upon receiving a silent push, I need to send an ajax request to the server, get back the data and save it (persist it with…
Yaron Levi
  • 12,535
  • 16
  • 69
  • 118
10
votes
1 answer

Background request not execute Alamofire Swift

I'm trying to make calls in background like POST,GET to be more precise in the didReceiveRemoteNotification method, because they start to work as a push notification arrive. My problem is that all the Alamofire.request are never call in Background…
10
votes
2 answers

Alamofire.request vs. manager.request - manager not working

EDIT: the question was not about what -999 means, but why do I not get an error with the first code fragment, but with the second? Apart of using the Alamofire.Manager in the second code snippet (that should work identical to the Alamofire.request…
brainray
  • 12,512
  • 11
  • 67
  • 116
10
votes
2 answers

Alamofire Get Request and JSON Response

I'm trying to use the Yoda API and send a request using the Alamofire Swift framework. I know that the API is correctly working, as I have tested the endpoint with my Mashape API key multiple times. I can also see that the requests are being sent…
Patrick Zawadzki
  • 456
  • 2
  • 6
  • 26