TIZEN to WEAR OS how send a POST JSON

Solution 1:

You might find OkHttp much more intuitive to use.

https://square.github.io/okhttp/#post-to-a-server https://square.github.io/okhttp/recipes/#posting-a-string-kt-java

        // Store this somewhere as a singleton
        val client = OkHttpClient()

        val request =
            Request.Builder()
                .url("https://xxxxxxx.it:8132/yyy/qqqqq")
                .post("{\"cmd\":\"$cmdx\"}".toRequestBody("application/json".toMediaType()))
                .build()

        val response = client.newCall(request).execute()

        if (response.isSuccessful) {
            val output = response.body!!.string()
        }