You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately I cannot create a new "siesta-swift" since I haven't got enough reputation to create a new tag.
Siesta configuration & login server call
let api = Service(base: "http://myapidomain.net/rest")
enabledLogCategories = LogCategory.all
let parameters = ["username": "username", "password": "password"]
api.resource(url: "users/login").request(.POST, json: NSDictionary(dictionary: parameters)).success { data in
debugPrint("success logging in")
}.failure { error in
debugPrint("failed to log in")
}
Debug log
[Siesta:Configuration] Computing configuration for Siesta.Resource(users/login)[]
[Siesta:Configuration] Applying config 0 [Siesta default response transformers] to Siesta.Resource(users/login)[]
[Siesta:NetworkDetails] Request:
headers: (1)
Content-Type: application/json
[Siesta:Network] POST users/login
[Siesta:Network] – ← POST users/login
[Siesta:NetworkDetails] Raw response headers: –
[Siesta:NetworkDetails] Raw response body: 0 bytes
[Siesta:NetworkDetails] Response after transformer pipeline: (new data)
Failure
userMessage: "unsupported URL"
nsError: "unsupported URL"
"failed to log in"
The text was updated successfully, but these errors were encountered:
That's a good heads up about tagging requiring reputation on Stack Overflow. Hand’t even occurred to me! Perhaps I'll rethink that recommendation about getting help in the README.
The Service.resource(url:) method — the one with the parameter labeled url: — expects a complete URL. It looks like you want Service.resource(_:), which takes a path relative to the Service’s base URL.
Over at SO I have posted a question about siesta erroring-out on a simple post request:
http://stackoverflow.com/questions/33147850/siesta-ios-post-request-errors-out-with-unsupported-url
Unfortunately I cannot create a new "siesta-swift" since I haven't got enough reputation to create a new tag.
Siesta configuration & login server call
Debug log
The text was updated successfully, but these errors were encountered: