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
2
votes
1 answer

How to pass same parameter with different value

I am trying the following API using Alamofire, but this API has multiple "to" fields. I tried to pass an array of "to" emails as parameters. It shows no error but did not send to all emails. API is correct, I tested that from terminal. Any…
Md. Najmul Hasan
  • 605
  • 1
  • 6
  • 19
2
votes
1 answer

AFNetworking 2 + SwiftyJSON

SwiftyJSON https://github.com/SwiftyJSON/SwiftyJSON looks really promising. However, the instructions only talk about integration with Alamofire (AFNetworking for Swift). However, due to the nature of the current project, it's already using…
netwire
  • 7,108
  • 12
  • 52
  • 86
2
votes
1 answer

swift: cast incoming json array to dictionary and object

I am toying around/learning Swift and JSON atm and have problems correctly casting around my responses. So, what I am trying to achieve is displaying a list of "posts" via Alamofire request. I have no problems displaying "first-level" json items…
longbow
  • 1,593
  • 1
  • 16
  • 39
2
votes
1 answer

Parsing JSON Response with Alamofire in Swift

When using the Alamofire Framework, my responses don't seem to be getting parsed correctly. The JSON response I get has some keys that appear to not be strings, and I don't know how to reference them/get their values. Here is the part of my code…
jaredsmith
  • 7,306
  • 3
  • 20
  • 31
2
votes
1 answer

Dictionary is not convertible to Void

Hi guys I've been searching the net without much luck but I'm trying to get around Alamofires asynchronous nature. I'm trying to return the JSON response as a dictionary but Xcode is giving me "Dictionary is not convertible to 'Void'" func…
User4
  • 1,330
  • 2
  • 15
  • 18
2
votes
2 answers

How to resolve class name clashing in Swift

I'm using Alamofire and SwiftyJSON libs in my Swift-based iOS app, and the problem is they both have a "JSON" class, which of course doesn't work. How to solve this? Is it possible to use namespaces, or something similar? Would compile these classes…
devguy
  • 2,336
  • 5
  • 27
  • 31
2
votes
4 answers

Handle JSON Response with Alamofire in Swift

sorry for my bad english :) I have a problem to parse JSON response over Alamofire in Swift for an iOS app. I wrote a function to return a string of JSON response. The request and response handling I do with Alamofire and the JSON handling I do with…
GRme
  • 2,707
  • 5
  • 26
  • 49
2
votes
1 answer

Alamofire and Concurrent Operation Queues

I'm using Alamofire (AF) in a concurrent operation queue to run network commands in my project. Sometimes AF's completionHandler doesn't fire, leaving my NSOperation hanging (waiting for a finish message that it will never receive). Eg. I'll see the…
mark.siedle
  • 78
  • 2
  • 6
1
vote
0 answers

How to implement a smart response cache depending on the error in the response?

Good afternoon, Everyone! I'm trying to make sure that the cache is used only for the scenario when I get an error in the response (not any error). Take data from the cache only if there is no Internet or did not wait for a response, but only for…
1
vote
0 answers

Library not loaded: @rpath/Alamofire.framework/Alamofire Swift

I am making build of my project, but i am not able to make build because some errors accors like dyld[42806]: Library not loaded: @rpath/Alamofire.framework/Alamofire Referenced from: <09986113-043E-33EF-8AE9-D34818E16FDC>…
Shubham
  • 51
  • 2
1
vote
1 answer

Generic parameter 'T' could not be inferred Alamofire

Following the Alamofire Documentation for multipart form data uploads the request should be something like this: AF.upload(multipartFormData: { multiPart in multiPart.append(data!, withName: "file", fileName: logFileName, mimeType:…
ez4nick
  • 9,756
  • 12
  • 37
  • 69
1
vote
0 answers

Unexpected Crash when Handling Alamofire DataRequest Response

I get a crash in Alamofire on iOS devices (iPhone XR, iPhone 13Pro), but don't get on the simulator or when I run as a Mac App. All iOS devices (both Simulator and Actual devices) all on iOS16.4.x It always occurs at the same point in…
Noodle2014
  • 11
  • 3
1
vote
1 answer

keyNotFound Swift Alamofire

Model Class public struct Products : Codable { let data: [ProductData] let error: Bool let message: String } public struct ProductData : Codable { let id, category, subCategory, name, status: String } ViewModel Class : import…
SasidharanIOS
  • 252
  • 1
  • 3
  • 12
1
vote
0 answers

iOS - Duplicate GET request are sent when switching to background

When switching my app to background / home screen and HTTP GET requests are firing, in some rare cases i can see that the server gets 2 identical request with the same oauth signature and throws an 401 error. I Create an oauth1 GET request using…
1
vote
1 answer

Adapt Alamofire requests in RetryPolice

i used RetryPolicy in my code with this class: open class ConnectionLostRetryPolicy: RetryPolicy { public init(retryLimit: UInt = RetryPolicy.defaultRetryLimit, exponentialBackoffBase: UInt =…
Sajjad
  • 1,536
  • 2
  • 17
  • 31
1 2 3
99
100