HttpClientToCurl 2.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package HttpClientToCurl --version 2.0.3
                    
NuGet\Install-Package HttpClientToCurl -Version 2.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HttpClientToCurl" Version="2.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HttpClientToCurl" Version="2.0.3" />
                    
Directory.Packages.props
<PackageReference Include="HttpClientToCurl" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HttpClientToCurl --version 2.0.3
                    
#r "nuget: HttpClientToCurl, 2.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HttpClientToCurl@2.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HttpClientToCurl&version=2.0.3
                    
Install as a Cake Addin
#tool nuget:?package=HttpClientToCurl&version=2.0.3
                    
Install as a Cake Tool

This extension will help you see whatever is set in HttpClient as a curl script.
Sometimes we may want to connect with an external service provider but when calling we come across many errors and we should spend a lot of time resolving errors. It happened to me many times;
for example, the external service provider expects properties a request to be sent to it in the form of The Camel case but we send data to it in the form of The Pascal Case. after much investigation, we have realized this issue. Or it is possible we forget to send one Property or a Header or we made a mistake in filling in the value of a Header or Property
and many issues like these, which we spent a lot of time resolving.
this extension makes our work very easy.
Before sending data to the service provider, this extension can show us exactly what we send it. (in the form of a curl in the console or in the file).
After getting the curl, we can now call it in the terminal or import it in the Postman and check with the documents provided by the provider.

You have 3 ways to see script results:

1- Write in the console:

    httpClient.GenerateCurlInConsole(httpRequestMessage, null);

2- Write in a file:

    httpClient.GenerateCurlInFile(httpRequestMessage, null);

3- Put into a variable:

   string script = httpClient.GenerateCurlInString(httpRequestMessage, null);

Read more about this extension:
https://medium.com/@amin.golmahalle/how-to-generate-curl-script-of-the-httpclient-in-net-c539da7c6588

Source Address:
https://github.com/amingolmahalle/HttpClientToCurlGenerator

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on HttpClientToCurl:

Package Downloads
PubSea.Framework

It is a Domain Driven Design Framework, including contracts for creating unified rest api and some helpers.

SomeGenericDev.RestSharpToCurl

A tiny and hacky library that uses reflection and DelegatingHandlers to generate a cURL script out of RestSharp's requests.

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on HttpClientToCurl:

Repository Stars
Reaparr/Reaparr
Plex downloader that brings content from any server to yours!
amingolmahalle/HttpClientToCurlGenerator
HttpClientToCurl is a NuGet package for .NET that generates cURL scripts from HttpClient requests in C# (CSharp). It supports GET, POST, PUT, and DELETE methods and handles content types like application/json, text/xml, and application/x-www-form-urlencoded. Convert your HttpClient requests easily into executable cURL commands.
Version Downloads Last Updated
2.1.1 17,417 12/24/2025
2.1.0 1,643 12/22/2025
2.0.9 1,323 12/18/2025
2.0.8 2,390 12/13/2025
2.0.7 95,657 8/21/2025
2.0.6 867,534 3/13/2024
2.0.5 42,098 1/19/2024
2.0.3 11,666 12/20/2023
2.0.2 101,071 10/1/2023
2.0.1 7,401 8/13/2023
2.0.0 21,602 5/25/2023
1.9.0 24,781 3/13/2023
1.8.9 1,580 3/1/2023
1.8.8 4,008 2/9/2023
1.8.7 1,593 2/7/2023
1.8.6 1,547 2/6/2023
1.8.5 1,593 1/25/2023
1.8.3 1,909 11/23/2022
1.8.2 1,626 10/31/2022
Loading failed

This extension will help you see whatever is set in HttpClient as a curl script.
Sometimes we may want to connect with an external service provider but when calling we come across many errors and we should spend a lot of time resolving errors. It happened to me many times;
for example, the external service provider expects properties a request to be sent to it in the form of The Camel case but we send data to it in the form of The Pascal Case. after much investigation, we have realized this issue. Or it is possible we forget to send one Property or a Header or we made a mistake in filling in the value of a Header or Property
and many issues like these, which we spent a lot of time resolving.
this extension makes our work very easy.
Before sending data to the service provider, this extension can show us exactly what we send it. (in the form of a curl in the console or in the file).
After getting the curl, we can now call it in the terminal or import it in the Postman and check with the documents provided by the provider.

You have 3 ways to see script results:

1- Write in the console:

    httpClient.GenerateCurlInConsole(httpRequestMessage, null);

2- Write in a file:

    httpClient.GenerateCurlInFile(httpRequestMessage, null);

3- Put into a variable:

   string script = httpClient.GenerateCurlInString(httpRequestMessage, null);

Read more about this extension:
https://medium.com/@amin.golmahalle/how-to-generate-curl-script-of-the-httpclient-in-net-c539da7c6588

Source Address:
https://github.com/amingolmahalle/HttpClientToCurlGenerator