cURL to C#

Paste a curl command and get equivalent C# HttpClient code, with headers, JSON body, cookies, and auth already translated.

curl Command

C# (HttpClient)

Summary

Paste a curl command and get equivalent C# HttpClient code, with headers, JSON body, cookies, and auth already translated.

How it works

  1. Paste a curl command, including one copied from a browser devtools network tab.
  2. The parser tokenizes the command, honoring quotes and backslash line continuations.
  3. Flags such as -X, -H, -d, -b, -u, -F, and -G are mapped to their HttpClient equivalents.
  4. A JSON body is detected automatically and sent with StringContent using the application/json media type.
  5. The generated C# program appears in the output box, ready to copy into a Program.cs file.

Use cases

  • Turn a "Copy as cURL" request from browser devtools into a C# test program.
  • Reproduce an API call from documentation or a support ticket in C#.
  • Convert a curl example from a README into a starting point for a .NET client.
  • Debug an API integration by replaying the exact request curl sent, in C#.
  • Translate a webhook test command into a repeatable C# console app.
  • Build a quick HttpClient call around a request captured from a mobile app proxy.

Frequently Asked Questions

Last updated: 2026-07-23 · Reviewed by Nham Vu