Vai al contenuto principale
Direct WebTools

Convertitore da cURL a codice online gratuito

Converti comandi cURL in codice C# HttpClient, JavaScript fetch, axios, Python requests, Go e PHP online, direttamente nel browser, senza inviare nulla ai server.

Elaborazione 100% locale — il comando cURL (comprese le credenziali) viene convertito interamente nel tuo browser e mai inviato a server.

Supportate: -H/--header <Nome: valore>, -X/--request, -d/--data/--data-raw/--data-binary, --data-urlencode, -F/--form, --form-string, -u/--user, --url, -G/--get, -I/--head, -A/-e/-b. Ignorate: -s -k -v -L -i --compressed --max-time 30 -o /dev/null e flag di trasporto simili.

Lingua di destinazione
Codice generato
caratteri

Przykłady

Clicca su un esempio per compilare il campo e convertire. La colonna del risultato mostra il codice effettivamente generato per la lingua predefinita (C#).

Wejście Wynik
curl https://api.example.com/v1/users using System.Text; var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.example.com/v1/users"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);
curl -X POST -H "Content-Type: application/json" -d "{\"name\":\"Ana\",\"age\":30}" https://api.example.com/v1/users using System.Text; var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.example.com/v1/users") { Content = new StringContent("{\"name\":\"Ana\",\"age\":30}", Encoding.UTF8, "application/json"), }; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);
curl -H "Accept: application/json" -H "Authorization: Bearer token123" https://api.example.com/v1/secure using System.Text; var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.example.com/v1/secure"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer token123"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);
curl -F name=Ana -F [email protected] https://api.example.com/upload using System.Text; var client = new HttpClient(); var form = new MultipartFormDataContent(); form.Add(new StringContent("Ana"), "name"); form.Add(new FormFileContent([]), "photo", "photo.png"); // upload placeholder var request = new HttpRequestMessage(HttpMethod.Post, "https://api.example.com/upload") { Content = form }; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);
curl -G -d page=2 -d limit=50 https://api.example.com/v1/users using System.Text; var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.example.com/v1/users?page=2&limit=50"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);

Domande frequenti

Il mio comando cURL viene inviato a qualche server?

No. Il parsing e la generazione del codice avvengono interamente nel tuo browser — il comando, comprese le credenziali, non lascia mai la pagina.

Quali flag di cURL sono supportate?

Le flag di richiesta -H, -X, -d (anche --data-raw, --data-binary e --data-urlencode), -F, --form-string, -u, --url, -G, -I, -A, -e e -b. Le flag di trasporto come -s, -k, -L, --compressed e --max-time vengono ignorate.

In quali linguaggi è possibile convertire il comando?

C# (HttpClient), JavaScript fetch, axios, Python (requests), Go (net/http) e PHP (cURL). Cambia usando le schede sopra l'output.