Kotlin

Control Rclone from Kotlin using the remote control HTTP API with HttpClient.

Kotlin can leverage Java's HttpClient for HTTP requests, providing a clean and concise way to interact with Rclone's remote control API.

Usage

import java.net.URI
import java.net.http.HttpClient
import java.net.http.HttpRequest
import java.net.http.HttpResponse

fun main() {
    val client = HttpClient.newHttpClient()
    val request = HttpRequest.newBuilder()
        .uri(URI.create("http://localhost:5572/"))
        .build()
    val response = client.send(request, HttpResponse.BodyHandlers.ofString())
    println(response.body())
}

How is this guide?

On this page