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
6 answers

JSON encoding with backslashes

I m using Alamofire and SwiftyJSOn to parse JSON output. It works very well however some sites give json with escaped output. I use Alamofire like below Alamofire.request(.POST, url, parameters: param, encoding: .JSON) .responseJSON {…
Meanteacher
  • 2,031
  • 3
  • 17
  • 48
10
votes
1 answer

Alamofire request with cookies

I'm beginner and I can't figure out how to make a .GET request (however it requires autenthication) with Alamofire. I managed to do this with other web service (login) because it takes parameters argument: parameters = [ "username" :…
Cahir09
  • 501
  • 6
  • 14
10
votes
2 answers

Multiple encoding types for Alamofire Request

I need to make a POST request with an HTTP Body with a JSON object, but I also need to use url query parameters in the same request. POST: http://www.example.com/api/create?param1=value¶m2=value HTTP Body: { foo : [ bar, foo], bar: foo} Is this…
AnthonyMDev
  • 1,496
  • 1
  • 13
  • 27
10
votes
1 answer

Swift: Getting "ambiguous expression" when try to pass tuple to callback function

I have this class for authenticating a user against my backend. class BackendService { class func performLogin(#email: String, password: String, success:((res: NSHTTPURLResponse, json: JSON, statusCode: HTTPStatus))->(), failure: (NSError)->())…
Thanos
  • 844
  • 2
  • 11
  • 27
10
votes
2 answers

Setting client-side timeout per request with Alamofire [swift]?

I'm trying to set a client-side timeout per request for Alamofire for Swift. The lead architect told me to set this on NSURLRequest, but I'm completely confused on how to actually do that in practice. Can someone who has done this give an example?…
Troy Payne
  • 343
  • 2
  • 3
  • 9
10
votes
6 answers

Swift: Handling JSON with Alamofire & SwiftyJSON

This is sure to be asked several times, but I have not yet found the right answer, although I have been looking very hard. I use Alamofire and SwiftyJSON and my JSON data looks like that: { "528" : { "name" : "Name 1", "id" : "528", …
vk72
  • 111
  • 1
  • 1
  • 5
10
votes
1 answer

Remembering cookies with Alamofire

I'm trying to make my Alamofire manager instance automatically remember & set cookies, here is my unsuccessful attempt : let cfg = NSURLSessionConfiguration.defaultSessionConfiguration() let cooks = NSHTTPCookieStorage.sharedHTTPCookieStorage() //…
user2629998
9
votes
1 answer

Module 'Alamofire' has no member named 'SessionManager'

Why I am getting this error, I didn't got. I already changed Alamofire to AF as using Alamofire 5. Please guide what's wrong and what need to change. Below is my code where i am getting error: private func callAlamoFireFormalData(makeThisFunction :…
iPhone 7
  • 1,731
  • 1
  • 27
  • 63
9
votes
1 answer

Alamofire error copying matching creds - Swift

we are working to get an upload to an API with a POST method. We are trying to push an image. We are getting the next error success(request: 2018-02-03 16:27:53.087629-0800 Optimio-iOS[5425:201118] CredStore - performQuery - Error copying matching…
Pol Valls Ortiz
  • 282
  • 2
  • 14
9
votes
2 answers

swift JSON login REST with post and get response example

It's my first experience with REST in iOS development with swift. I couldn't find any working or straight (simple) example for doing what i need here. I have a login backend (https://myaddress.com/rest/login), where I need to pass 2 params: login…
M. Wojcik
  • 2,301
  • 3
  • 23
  • 31
9
votes
1 answer

Swift - Dynamic UITableViewCell size based on image aspect ratio

I'm trying to create dynamically sized UITableViewCells, changing the height based on the aspect ratio of an image downloaded from a server. For example, if an image's height is double its width, I want the UITableViewCell's height to be double the…
dan martin
  • 1,307
  • 3
  • 15
  • 29
9
votes
5 answers

How to set Cookies in alamofire?

How to set Cookies in Alamofire such that such that every time I kill the app and restart it, the same cookie is sent?
Gaurav
  • 143
  • 1
  • 3
  • 10
9
votes
2 answers

How to send total model object as a parameter of Alamofire post method in Swift3?

I have a model class like this class Example() { var name:String? var age:String? var marks:String? } I'm adding data to that model class let example = Example() example.name = "ABC" example.age = "10" example.marks = "10" After that I…
Tirupatirao
  • 165
  • 3
  • 9
9
votes
4 answers

iOS Framework on device bitcode not included

I am developing static library for iOS, in which I am using Alamofire. When I try to build for release for simulator, everything is ok, however when I try to build it for device (release or debug) I get following problem: ld: bitcode bundle could…
Tomasz Czura
  • 2,414
  • 1
  • 14
  • 18
9
votes
3 answers

Type of expression is ambiguous without more context in Alamofire.upload swift 3

Updated Alamofire 4.0.0 does not mention how to put Httpmethod & Httpheaders in upload with multipartFormData. That's why I google and found solution in that stackoverflow question. But the problem is I did same as that answer then got following…
PPShein
  • 13,309
  • 42
  • 142
  • 227