https://kotlinlang.org logo
#ktor
Title
# ktor
n

Nikolai

07/23/2019, 3:48 PM
Hi, everyone How can I perform an http request (post/get) from ktor server to another server api? A short example will be perfect.
n

Nikolai

07/23/2019, 3:51 PM
It is possible to do it on server side?
👌 2
v

voben

07/23/2019, 3:53 PM
You can even use okhttp if you’re working in the JVM/Android world. The docs explain this pretty well https://ktor.io/clients/http-client/engines.html
n

Nikolai

07/23/2019, 3:54 PM
Ok, sorry used ktor on client side but though that for server side will another way.
Thank you
s

Shawn

07/23/2019, 3:56 PM
I’m not sure if I understand you correctly but to be clear, you can just instantiate a Ktor HttpClient within your Ktor server and use it normally
n

Nikolai

07/23/2019, 4:00 PM
Yes, you understood everything right. Thanks
👍 1