Lukasz Kalnik
02/04/2022, 11:58 PMdefaultRequest
seems not to work anymore:
HttpClient {
// ...
defaultRequest {
url {
protocol = URLProtocol.HTTPS
host = "<http://api.themoviedb.org|api.themoviedb.org>"
encodedPath = "/3$encodedPath" // prepend API version to path
parametersOf("api_key", "my_api_key_value")
}
}
}
suspend fun getConfiguration(): ApiConfig = client.get("configuration").body()
produces:
io.ktor.client.plugins.ClientRequestException: Client request(GET <https://api.themoviedb.org/3/configuration>) invalid: 401 Unauthorized. Text: "{"status_code":7,"status_message":"Invalid API key: You must be granted a valid key.","success":false}
Aleksei Tirman [JB]
02/07/2022, 8:26 AMLukasz Kalnik
02/07/2022, 8:55 AM