What it does
Paste a curl command and get C# that sends the same request with HttpClient. It understands what DevTools and Postman actually produce: “Copy as cURL (bash)” with $'...' strings, “Copy as cURL (cmd)” with ^ escapes, Postman’s --location / --data-urlencode, line continuations with \, ^ or a backtick, and combined flags like -sSLk.
Notable features
- Two styles: a plain
HttpClientwith a reusableSocketsHttpHandler, or a typed client class registered withAddHttpClient<T>()forIHttpClientFactory, withBaseAddress, timeouts and handler settings in the registration. - The right content type: JSON bodies become
JsonContent.Create(...)with an anonymous object (or a raw string literal if you prefer exact bytes), form data becomesFormUrlEncodedContent,-FbecomesMultipartFormDataContentwith file parts. A raw multipart body copied from DevTools is split back into parts. - Auth done properly:
-u,--oauth2-bearerandAuthorizationheaders useAuthenticationHeaderValue;--digest/--ntlmuseNetworkCredential. - Headers HttpClient manages itself are skipped with a note:
Host,Content-Length,Connection, andAccept-Encoding(replaced by automatic decompression). Browser-onlysec-ch-*/sec-fetch-*headers can be dropped. - Notes explain anything that needs your attention:
-k, credentials in code, JSON sent without a Content-Type, shell variables, ignored options.
How to use it
Paste the command, pick HttpClient or Typed client, then copy or download the .cs file. The parsed-request table shows exactly how the command was understood. Click Example to cycle through a Chrome, Postman, Windows cmd and file-upload sample.
Privacy
Everything runs in your browser; nothing is sent anywhere. The last command is kept in local storage only when it contains no credentials (tokens, cookies, passwords).