https://kotlinlang.org logo
Title
s

snowe

01/25/2020, 3:51 AM
simple question. With ktor-oauth, does HttpClient need to be
Apache
? It doesn't seem to want to accept
Tomcat
, but I don't want to run two applications servers just to use oauth.
t

Tim Malseed

01/25/2020, 3:53 AM
It doesn’t seem to want to accept
Tomcat
What do you mean by this?
s

snowe

01/25/2020, 3:55 AM
I'm assuming that Apache is the HTTP server, and not the web container. I only have the
ktor-server-tomcat
dependency in my project, that's why I make that assumption
I'm guessing that Tomcat won't be able to double as the HTTP client here for some reason.
t

Tim Malseed

01/25/2020, 4:00 AM
It looks like your
HttpClient
isn’t an instance of
HttpClientEngine
. Do you need to create a wrapper class or something?
s

snowe

01/25/2020, 4:01 AM
Tomcat is a built in ktor servlet, in
ktor-server-tomcat
. I didn't create it. I just wanted to confirm that I'd need to add apache as a dependency, even though I already have tomcat.
t

Tim Malseed

01/25/2020, 4:02 AM
Yeah, I’m not sure - someone else might be able to answer. But to me, this doesn’t necessarily look like the problem is you haven’t added Apache. The problem is your HttpClient doesn’t extend HttpClientEngine, which is what the OAuth configuration is expecting.
You may be able to resolve this without adding a dependency on Apache
s

snowe

01/25/2020, 4:03 AM
yeah I understand that.
t

Tim Malseed

01/25/2020, 4:09 AM
What is
Tomcat
in
HttpClient(Tomcat)
?
m

muliyul

02/06/2020, 10:24 AM
Tomcat is a server engine. You'd want to use one of the client engines: https://ktor.io/clients/http-client/engines.html