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
9
votes
2 answers

Download file cause issue for streaming in ios

I am using Live streaming with AVPlayer in my app & works fine. But when I try to download some file using Alamofire.downlaod method then stream is stop working. The rate property of AVPlayer is zero automatically. I think there may be some issue…
user2526811
  • 1,233
  • 4
  • 20
  • 54
9
votes
6 answers

Alamofire: [Result]: FAILURE: Error Domain=NSURLErrorDomain Code=-999 "cancelled"

The service I'm connecting to is using a self signed certificate. For dev purposes I do not want to validate that chain. Using swift 3 with Alamofire 4. Fixed the ATS accordingly: NSAppTransportSecurity
Sami M'Barek
  • 137
  • 1
  • 1
  • 9
9
votes
1 answer

Alamofire, Session Manager limit retry count

I'm using Alamofire's SessionManager to make requests to my API services. Is there a way to limit the retry counts in Alamofire? I'm using the new RequestAdapter and RequestTrier Protocols to provide a retry mechanims in Alamofire v4. I want to…
aymeba
  • 934
  • 1
  • 11
  • 26
9
votes
3 answers

PHP upload from iOS using Alamofire

I'm trying to upload 3 images to the server from iOS to my PHP service. For some reason the folder remains empty after posting, but the rest of the data goes through and gets persisted into mysql. My iOS code: Alamofire.upload(.POST, urlString,…
franklinexpress
  • 1,149
  • 14
  • 44
9
votes
1 answer

How add Int value to the Alamofire upload parameters

I want to add Int value to the multipartFormData: Alamofire.upload(.POST, url, headers: headers, multipartFormData: { multipartFormData in //add some jpg image …
biloshkurskyi.ss
  • 1,358
  • 3
  • 15
  • 34
9
votes
1 answer

Alamofire response object return 200 status code when my Rails server return 304

When I send a request to my rails server and get 304 not modified, almofire response object return status code 200. How can I change my request so I will get the 304 status code my rails server returns? I installed Alamofire using…
gal
  • 929
  • 4
  • 21
  • 39
9
votes
0 answers

AlamoFire Upload in Background Session

im trying to upload files to my server while the app is in background, i have an NSOperation set up as following: class uploadOperation: NSOperation { weak var request: Alamofire.Request? override func main() { let task =…
Bar
  • 603
  • 1
  • 7
  • 19
9
votes
1 answer

Populating tableview cells from JSON with Alamofire (Swift 2)

I have the following code. import UIKit import Alamofire class CheHappyTableViewController: UITableViewController, NSURLConnectionDelegate { var happyHours = [HappyHour]() override func viewDidLoad() { super.viewDidLoad() …
Rinor Bytyçi
  • 103
  • 1
  • 5
9
votes
1 answer

Alamofire error on carthage update

My Cartfile: github "ReactiveCocoa/ReactiveCocoa" "v4.0.0-alpha.4" github "ikesyo/Himotoki" ~> 1.3.0 github "Alamofire/Alamofire" ~> 3.1.2 github "Swinject/Swinject" == 0.5.0 github "Quick/Quick" == 0.8.0 github "Quick/Nimble" == 3.0.0 Error: ***…
MCMatan
  • 8,623
  • 6
  • 46
  • 85
9
votes
1 answer

Carthage setup fails with code 65

I'm installing carthage on a new machine. $ brew install Carthage [in project root] $ emacs Cartfile # Alamofire github "Alamofire/Alamofire" # SwifyJSON github "SwiftyJSON/SwiftyJSON" $ carthage update *** Fetching SwiftyJSON *** Fetching…
Marcus
  • 9,032
  • 11
  • 45
  • 84
9
votes
7 answers

How do I use JSON arrays with Alamofire parameters?

I'm having a bit of trouble structuring my parameters so that our server API would be able to read it as valid JSON. Alamofire uses parameters like this in swift language let parameters : [String: AnyObject] = [ "string": str "params": HOW I…
Miika Pakarinen
  • 261
  • 1
  • 4
  • 5
9
votes
1 answer

Do I need to wrap my Alamofire calls inside dispatch_async?

func authenticate(completion:(success: Bool) -> Void) { let qos = Int(QOS_CLASS_USER_INITIATED.value) dispatch_async(dispatch_get_global_queue(qos, 0)){ () -> Void in Alamofire.request(.POST, CONSTANTS.Domain+"/accounts", parameters: ["" :…
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080
9
votes
6 answers

Alamofire - NSURLCache is not working?

I set my cache as below var cacheSizeMemory = 20 * 1024 * 1024 var cacheSizeDisk = 100 * 1024 * 1024 var sharedCache = NSURLCache(memoryCapacity: cacheSizeMemory, diskCapacity: cacheSizeDisk, diskPath:…
aryaxt
  • 76,198
  • 92
  • 293
  • 442
9
votes
3 answers

How to run synchronically two functions with async operations on iOS using Swift

lets propose this scenario a method with async network operations func asyncMethodA() -> String? { result : String? Alamofire.manager.request(.POST, "https://www.apiweb.com/apimethod", parameters: parameters, encoding:.JSON) …
mike83_dev
  • 481
  • 1
  • 6
  • 11
9
votes
1 answer

canInitWithRequest method in custom NSURLProtocol class is not triggered when using Alamofire

I have a custom NSURLProtocol class to provide test data while I'm experimenting with Alamofire, but it doesn't seem to be used when making requests via the Manager request method. This request goes through and returns a result just fine, but does…
Doug Sjoquist
  • 735
  • 5
  • 9