cURL to C#

Paste a cURL command and convert it to C# HttpClient code in the browser. Headers and StringContent bodies are generated so you can drop the snippet into a .NET project.

cURL to: Java JavaScript Python PHP C# Go

About cURL to C#

Convert a cURL command to C# online and get HttpClient and HttpRequestMessage code for .NET. This free cURL to C# converter maps method, URL, headers, and StringContent so a copied shell command becomes an async snippet.

Authorization and custom headers use TryAddWithoutValidation so values that are not in the typed header set still compile. Content-Type is applied on StringContent rather than duplicated as a request header.

.NET developers paste cURL from Postman or DevTools and drop the result into a console app or test. Switch to Java or Go from the language row when the same call belongs in another stack.

Conversion is local in your browser. Use this free cURL to C# converter whenever you need HttpClient code from a cURL command.