Convert CURL commands to Kotlin code online

Curl command

Examples: GET - POST - JSON - Basic Auth - Files - Form

CURL to Kotlin online

This tool helps you to generate Kotlin code based on CURL command. Copy and paste CURL command and generate Kotlin.

What can you do with CURL to Kotlin converter online?

  • CURL to Kotlin is very unique tool to convert cURL command to Kotlin request of Kotlin. The input provide by the user's cURL command to generate Kotlin code.
  • This tool saves your time and helps to generate Kotlin code with ease.
  • CURL to Kotlin works well on Windows, MAC, Linux, Chrome, Firefox, Edge and Safari.

what is CURL?

CURL is an open-source command line tool that downloads files from the web. It supports a variety of protocols, including Kotlin, KotlinS, FTP, SFTP, TFTP, Gopher and others.

How do convert CURL to Kotlin code? 

Step1: Paste and convert your CURL requests to Kotlin code

Step2: Copy Kotlin code

Convert CURL to Kotlin example

CURL
curl example.com
Kotlin
import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Request

val client = OkHttpClient()

val request = Request.Builder()
  .url("http://example.com")
  .build()

client.newCall(request).execute().use { response ->
  if (!response.isSuccessful) throw IOException("Unexpected code $response")
  response.body!!.string()
}