any ideas someone?) or unclear?)
# android
m
any ideas someone?) or unclear?)
l
Does
API_AUTHORIZATIONS
equals to
api/mandarine/v1/authorizations
?
And what are you getting, can we see expected/was
?
m
yep
api/mandarine/v1/authorizations
myroute
clipped
i don t understand why)
l
Well, you’re not using the baseUri at all
I mean, you’re building a Uri with authority =
<http://google.com|google.com>
, scheme =
https
and appending the path
the
/myroute
does not belong to authority and you’re not setting it anywhere
m
i wrote smth like this:
Copy code
internal fun createRequestUrl(baseUrl: String, vararg routePaths: String): String {
    val baseUri = Uri.parse(baseUrl)
    Log.d("some", "baseUri: $baseUri")
    val builder = Uri.Builder()
        .scheme(baseUri.scheme ?: "https")
        .encodedAuthority(baseUri.authority ?: "")
    routePaths.forEach { builder.appendEncodedPath(it) }
    return builder.build().toString()
}
now checking
l
It should work as long as you’ll pass the list of paths you need, but you could also add
/myroute
to your
API_AUTHORIZATIONS
Or create a new cosnt val with it
m
I may not have it and every time it changes