Convert curl to Rust

Paste your curl command below — the Rust · reqwest code is generated instantly, entirely in your browser.

// your code will appear here

How the curl to Rust conversion works

The output uses reqwest with tokio: each -H flag becomes an entry in a HeaderMap, -u becomes basic_auth, and -d becomes .body(...) on the request builder.

Example

curl https://api.example.com/ping -H 'X-Api-Key: abc123'

becomes an async main that builds the request with reqwest::Method::GET and prints the status and body — paste your command above to see the full code.