A tool for converting a curl command to the corresponding Kotlin code with Ktor.
Just place the c2k
command before the curl
command. For example:
c2k curl -v --data-raw 'request-body' https://example.com
As a result, the generated code will be printed to stdout.
- Go to the GitHub releases page and download the appropriate binary
- Make it executable
chmod +x c2k-... # Replace with the correct filename
- Move it to a PATH directory:
sudo mv c2k-... /usr/local/bin/c2k
- Verify it works:
c2k --version