CURL kanggo Kotlin online
Alat iki mbantu sampeyan ngasilake kode Kotlin adhedhasar printah CURL. Salin lan tempel printah CURL lan generate Kotlin.
Apa sampeyan bisa nindakake karo konverter CURL menyang Kotlin online?
- CURL menyang Kotlin minangka alat sing unik banget kanggo ngowahi perintah cURL menyang panjaluk Kotlin saka Kotlin. Input kasebut diwenehake dening perintah cURL pangguna kanggo ngasilake kode Kotlin.
- Alat iki ngirit wektu lan mbantu nggawe kode Kotlin kanthi gampang.
- CURL to Kotlin bisa digunakake kanthi apik ing Windows, MAC, Linux, Chrome, Firefox, Edge lan Safari.
apa iku CURL?
CURL minangka alat baris perintah open-source sing ndownload file saka web. Ndhukung macem-macem protokol, kalebu Kotlin, KotlinS, FTP, SFTP, TFTP, Gopher lan liya-liyane.
Kepiye cara ngowahi CURL dadi kode Kotlin?
Langkah 1: Tempel lan ngowahi panjalukan CURL menyang kode Kotlin
Langkah 2: Nyalin kode Kotlin
Convert CURL kanggo conto Kotlin
KULIT
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()
}