trashcoder
10/28/2022, 5:01 PMDefaultRequest
plugin as described here:
https://ktor.io/docs/default-request.html#configure
i tried suppling the URL as complete string:
defaultRequest {
url("<https://ktor.io/docs/>")
}
and also tried setting the URL parameters by myself:
url {
protocol = URLProtocol.HTTPS
host = "<http://ktor.io|ktor.io>"
path("docs/")
}
the base URL i try to set is:
<https://api.ws.sonos.com/control/api/v1>
during debugging, the plugin shows the correct URL including all path segments. ✅
but the GET
request is executed without the path segments. ⛔
i receive this response (path is missing):
You don't have permission to access "http://api.ws.sonos.com/households" on this server.
for request:
httpClient.get("/households")
am i doing something wrong? is this a known issue?trashcoder
10/28/2022, 5:03 PMtrashcoder
10/28/2022, 5:11 PMtrashcoder
10/28/2022, 6:42 PM<https://api.ws.sonos.com/control/api/v1/>
and then this request will be successful:
httpClient.get("households")
🤷♂️