Questions tagged [siesta-swift]

Use [siesta-swift] for questions about the Siesta REST library for iOS. For the Javascript unit testing tool, use the tag [siesta].

Siesta is a REST framework for iOS apps. It provides a resource-centric alternative to the familiar request-centric approach to networking.

67 questions
0
votes
1 answer

Not able to install siesta 1.4.2

Not able to install siesta 1.4.2. By default, it is installing 1.1.1. Also getting below error with 1.1.1 :-1: unexpected duplicate task: CompileXIB …
Hiren
  • 101
  • 4
0
votes
1 answer

Get the HTTPURLResponse from a Siesta Response

I'm fighting against REST API that performs a 304 redirect; what I need is to take the destination URL of the redirect and open it with the browser (I know, it's a little of a perversion). I successfully intercepted the redirect, thanks to this nice…
AleGiovane
  • 172
  • 1
  • 13
0
votes
1 answer

Siesta-Swift: Is there a way to find out if Resource.latestData has changed?

My code looks like the following: let myAPI = Service(baseURL: "...") myAPI.resource("/...").addObserver(owner: self) { resource, event in } if the URL always returns 200 (NOT 301), is there a way to check resource or event if the data itself, the…
swalkner
  • 16,679
  • 31
  • 123
  • 210
0
votes
1 answer

Siesta REST login

How to translate my login user URLSession code into Siesta framework code? My current attempt isn't working. I've looked at the example in the GithubBrowser but the API I have doesn't work like that. The issue is that the user structure is kind…
Sez
  • 1,275
  • 11
  • 26
0
votes
1 answer

Making a network request with app in background with Siesta and Swift

I'm making an HTTPS request that's initiated from a UNUserNotification action, so it performs with my app running in the background. I suspect that this feature isn't supported by Siesta, in which case I'll make a feature request! But first I want…
davidgoli
  • 2,436
  • 1
  • 16
  • 13
0
votes
1 answer

Are Resources freed when they have no observers?

Are Resources freed when they have no observers? I have scenario where I want to cache some images but the view(s) displaying them may come and go. If I use RemoteImageView which handles its own observation of the image keyed on the URL but the…
Jason
  • 1
  • 1
0
votes
0 answers

Is there a way to increase the timeout with siesta framework

I searched on the docs of siesta framework but I couldn't find a way to set a timeout for a http request. I need to set a longer timeout because I'm sending a http request to a very slow web service and I receive a timeout error from the framework.…
AleGiovane
  • 172
  • 1
  • 13
0
votes
1 answer

Siesta as dependency in SwiftPM on linux

I have written a package that consumes Siesta, and I would like to be able to run automated tests for it on a linux platform using SwiftPM. I see that siesta has a Package.swift which declares the exclusion of SiestaUI, however I see that the…
qqq
  • 1,360
  • 1
  • 9
  • 24
0
votes
1 answer

Siesta Swift: RequestError.Cause.RequestCancelled not conform to _ErrorCodeProtocol

I'm trying to check what exact error a request might throw by doing some custom checks and throw my own custom errors. if let cause = resource.latestError?.cause { if case RequestError.Cause.RequestCancelled = cause { } } I get this…
apunn
  • 97
  • 8
0
votes
1 answer

Can I get Siesta to look at my persistent cache before making a network request?

I've started using Siesta while running in the background, using Apple's background fetch capabilities. One of the (many) difficult things to work with while running this way is that on some devices, the OS tends to kill my process frequently. I…
Jordan Wood
  • 2,727
  • 3
  • 12
  • 17
0
votes
1 answer

How to decorate a request with parameters?

How can I decorate all request adding to all request, custom parameters? I want to add the param key to all request. configure("**", description: "auth") { $0.decorateRequests(with: { (res, req) -> Request in ?? what to add…
0
votes
1 answer

Swift Siesta access response raw data

I've in my API a method that return a content of PDF file. How can I access the raw data of response in success callback?
etruta
  • 19
  • 1
  • 4
0
votes
0 answers

My resource observer closure was called twice with the same error, is this a bug?

I have a Siesta resource to which I use the closure version of AddObserver. Right now, the endpoint that that resource uses always returns a 404. Most of the time, the observing closure only gets called once with the error. However, I have a log…
Jordan Wood
  • 2,727
  • 3
  • 12
  • 17
0
votes
1 answer

Swift Siesta redirect response to failure

Is possible using Siesta pipeline, receive a success response, parsing it, and depending of the return, redirect it to a failure response? My server response many times return a HTTP 200, but with a error message/flag.
etruta
  • 19
  • 1
  • 4
0
votes
1 answer

Configure request method for a Siesta resource

I have this api where the login works via post while most other requests work with get. Now I am using siesta to define the login url as a resource. func login(username: String, password: String) -> Resource { return…
blackwolf123333
  • 313
  • 4
  • 13