Questions tagged [rxalamofire]

44 questions
1
vote
0 answers

How to refresh Api authorization token using Alamofire & rxSwift?

I try to manage rxswift & Alamofire to get response. These functions get response successfully when token is not expired. But when the token is expired, I don't know how to refresh token and then retry to get response using new token. What should I…
Beginnerrrrrr
  • 431
  • 1
  • 3
  • 20
1
vote
0 answers

RxAlamofire - Subscription not working

I'm learning RxAlamofire and I faced following issue: in this snippet fragment of code from onNext, onError and onCompleted doesn't get invoked, as if the subscription wasn't working at all. To compare, piece of code with normal Alamofire works just…
AndrzejZ
  • 215
  • 2
  • 8
1
vote
1 answer

RxAlamofire: retryWhen drops into subscribe block

I'm trying to implement an alamofire call with max retries. Code is below: RxAlamofire.request(.post, URL, parameters: parameters, encoding: JSONEncoding.default) .observeOn(MainScheduler.instance) .retryWhen { (errors: Observable)…
Matthew
  • 433
  • 1
  • 6
  • 15
0
votes
1 answer

Cannot find 'SessionManager' in scope?

I'm updating my code with RxAlamofire. I updated RxAlmofire with lastest version. How can i update this code config.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders in let config = URLSessionConfiguration.default …
minhtam23
  • 29
  • 5
0
votes
0 answers

Handle timeouts in RxAlamofire

In an application that I am developing I need to make some calls to a server. For this I use RxAlamofire, but I am encountering a problem when handling timeouts. The code I use to call is the following: func rxSingleAuthentification
RFG
  • 2,760
  • 2
  • 26
  • 43
0
votes
0 answers

RxAlamofire gap between subscription and emission times

We're making requests using RxAlamofire with the following code self.scheduler = ConcurrentDispatchQueueScheduler(qos: .userInitiated) func postRequest(_ path: String, parameters: [String: Any]?) -> Observable { let absolutePath =…
Maria
  • 324
  • 2
  • 17
0
votes
1 answer

Created observable doesn't emit anything

I'm trying to create a function which returns Observable<(HTTPURLResponse, Any)> using RxAlamofire: class APIManager { let disposeBag = DisposeBag() func getResponse(credentialData: Credentials, ulr: String)->Observable<(HTTPURLResponse,…
0
votes
1 answer

Result of call to 'subscribe(onNext:onError:onCompleted:onDisposed:)' is unused

I am trying to create function which return Observable<(HTTPURLResponse, Any)> using RxAlamofire: func getResponse(credentialData: Credentials, ulr: String)->Observable<(HTTPURLResponse, Any)>{ let credentialData =…
0
votes
1 answer

Where is the actual API call within this RxAlamofire source code?

I'm trying to figure out where data in an API call is coming from. Specifically, I want to know where req.user is coming from as from what I can tell there's no paramters being passed into the API call. Here's the server-side code (in JS): let…
branx
  • 43
  • 4
0
votes
0 answers

How to convert URLRequest to Alamofire.URLConvertible

how to covert URLRequest to Alamofire URLConvertible I am getting error while trying to convert following is my code var request = URLRequest(url: URL(string: "some url")!) request.httpBody = json RxAlamofire.request(.post, request as!…
alphanso
  • 257
  • 3
  • 17
0
votes
3 answers

RxAlamofire make post call with json body

I want to make post call using RxAlamofire not able to find any method to do so tried using requestJSON method but there is no paramter to pass post json in RxAlamofire.requestJSON(.post, url) how to make post call and pass json data to post call…
alphanso
  • 257
  • 3
  • 17
0
votes
1 answer

RxAlmofire pass parameters to requestJSON [:]

Following is method provided by RxAlamofire for making requestJSON request there is no method to pass parameters [String : String] RxAlamofire.requestJSON(.get, url) .subscribe(onNext: { [weak self] (r, json) in if let jsonResult…
amodkanthe
  • 4,119
  • 4
  • 27
  • 55
0
votes
1 answer

Is there a way to quit browser session in Swift or RxAlamofire?

I am web scrapping a specific website to which the user has to be logged in. It is simple to logout the user, but after the logout the site requires the user to "close the browser". If the user only closes the tab and then re-enters the site, they…
eja08
  • 4,218
  • 3
  • 6
  • 17
0
votes
1 answer

RxAlamofire request is not fired for the second time i call the function

I have a function which is supposed to return an Observable. When I call the function for the first time, everything goes fine and I receive the result I expected, but for the second time that I want to make the same request with different…
eja08
  • 4,218
  • 3
  • 6
  • 17
0
votes
1 answer

ObjectMapper - map JSON dictionary as nested object

I am trying to user ObjectMapper to consume JSON response. So far my response looks like this: { "paramsStructure": [ { "tiles": { "0": { "layout": { "column": 0, "colSpan": "1", …