Is there a standard way to exchange json data (text) between Kotlin and a Python program ?
m
Martin Nowosad
12/10/2020, 9:36 AM
write the json to a file
b
Benjamin Vallet
12/10/2020, 9:38 AM
I mean to send the json data through a TCP socket
r
Rob Elliot
12/10/2020, 9:51 AM
HTTP would seem like the most common way, using common HTTP server, HTTP client & JSON serialization libs on either side.
On the kotlin side, http4k or ktor for HTTP & jackson for JSON are common & will do the job. Python must have equivalents.
m
Martin Nowosad
12/10/2020, 9:53 AM
you’d need to create a server (backend) then on both sides, on Python you can use Flask or FastAPI (django is too much) and on kotlin you can launch a ktor server
Martin Nowosad
12/10/2020, 9:54 AM
on Python you can do the requests through the module
requests
and with kotlin ktor has all the tools for u ready