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
13
votes
5 answers

Error while parsing JSON "Unescaped control character around character 981"

Error Domain=NSCocoaErrorDomain Code=3840 "Unescaped control character around character 981." UserInfo={NSDebugDescription=Unescaped control character around character 981.} I am getting the above error in response to a request. Below are the…
Payal Maniyar
  • 4,293
  • 3
  • 25
  • 51
13
votes
5 answers

Is there a way to do Alamofire requests with retries

I have a lot of places in the code where Alamofire request/response are handled. Each of this requests may fail because of some intermittent problem (the most common is flaky network). I would like to be able to retry requests 3 times before…
Victor Ronin
  • 22,758
  • 18
  • 92
  • 184
13
votes
5 answers

"No such module 'Alamofire'" Xcode won't recognize Alamofire framework

I realize that the same error was asked in other questions (like here), but their solutions are not working for me. I keep getting a build failure in my app: "No such module 'Alamofire'". I followed the cocoadocs installation instructions (here) for…
S.Sohi
  • 671
  • 2
  • 6
  • 9
13
votes
3 answers

Certificate pinning in Alamofire

I am creating an iPad app that accesses HTTPS web services. I want to implement pinning, but am having issues. This class creates the Alamofire Manager (mostly taken from documentation): class NetworkManager { var manager: Manager? init()…
Mark Tickner
  • 1,023
  • 2
  • 15
  • 26
13
votes
2 answers

Using Alamofire with an iOS 8.0 Embedded Framework

I am trying to use Alamofire within a custom framework that I am creating. I created my custom framework project, added the Podfile, installed Alamofire. I then created a sample project to test out my custom framework. The sample project is…
user4781334
  • 374
  • 2
  • 8
13
votes
3 answers

How to get response headers when using Alamofire in Swift?

I'm using Alamofire for my Rest (POST) request and getting JSON response seamlessly. But i can access only response body. I want to get response headers. Isn't it possible when using Alamofire? Here is my code snippet: @IBAction func…
Oguz Ozkeroglu
  • 3,025
  • 3
  • 38
  • 64
13
votes
4 answers

Using Alamofire within a Playground

I'm new to iOS development and using Xcode and I'm having trouble getting Alamofire to work within a Playground. There's some functionality I'd like to test out for proof of concept but the library is not linked to the Playground and I've tried…
Petesta
  • 1,623
  • 3
  • 19
  • 29
12
votes
3 answers

Alamofire auto refresh token and retry previous API call in iOS Swift 4

now I'm working on an iOS application in Swift 4. Here I'm using Alamofire to integrate the API calls. I need to integrate the right way to auto-refresh the authentication token and retry the previous API calls. I'm storing the authentication token…
Hilaj S L
  • 1,936
  • 2
  • 19
  • 31
12
votes
1 answer

Alamofire request always fails with "The request timed out" if Socket.io is connected

if socket.io is connected Alamofire is not working as expected, always getting req time out error. Alamofire works if i disable Socket.io this is the error i'm getting Error Domain=NSURLErrorDomain Code=-1001 "The request timed out."…
name-it
  • 2,238
  • 3
  • 19
  • 28
12
votes
1 answer

How to get cached responses using Alamofire while app is in offline?

After I got a response via Alamofire, in some cases, implementing a database or managing local storage myself (file etc.) can be a bit overkill. I know about Alamofire's requestCachePolicy and it is already caching responses (based on…
Jakub Truhlář
  • 20,070
  • 9
  • 74
  • 84
12
votes
1 answer

Keep Alive not working properly on iOS

I am currently developing an application where we need some request to hit our server ASAP. To speed up the request process we have to eliminate handshake (as it takes extra) and have a permanent connection. The application is using the Alamofire…
zirinisp
  • 9,971
  • 5
  • 32
  • 38
12
votes
2 answers

How to check Alamofire library version?

I implemented Alamofire using cocoapod.I am using Xcode7.3.1. My podfile is like the following way # Uncomment the next line to define a global platform for your project # platform :ios, '9.0' target 'ALamoWeather' do # Comment the next line if…
IKKA
  • 6,297
  • 7
  • 50
  • 88
12
votes
1 answer

How to migrate Alamofire router class to Swift 3?

Does anybody know how to change this entire approach to Swift 3? At this moment I have something very similar to this working OK on Swift 2.2 but now I'm trying to change that to Swift 3. I am getting some errors with the "URLRequestConvertible",…
Gabriel Candia
  • 282
  • 4
  • 14
12
votes
11 answers

Xcode can't find Alamofire, error: No such module 'Alamofire'

I'm trying to include Alamofire in my Swift project following the github(https://github.com/Alamofire/Alamofire#cocoapods) instruction. I've created a new project, navigated to the project directory and run this command sudo gem install cocoapods.…
Mostafiz Rahman
  • 8,169
  • 7
  • 57
  • 74
12
votes
4 answers

How to cancel Alamofire.upload

I am uploading images on server via Alamofire.upload as multipart data. Unlike Alamofire.request it's not returning Request object, which I usually use to cancel requests. But it's very reasonable to be able to cancel such a consuming requests like…
simd
  • 1,779
  • 3
  • 17
  • 23