-
Notifications
You must be signed in to change notification settings - Fork 17
GetStarted
mozhganEtaati edited this page Oct 14, 2025
·
6 revisions
It’s easy to use HttpClientToCurl!
You need to install the package in your .NET project and use the sample codes below to see how to call and work with the extensions.
To add the package to your project from NuGet, use the following command:
dotnet add package HttpClientToCurlOr visit the NuGet page here: HttpClientToCurl
You can see quick samples of getting curl from HttpClient or HttpRequestMessage in .NET below:
You have 3 Quick ways to see the generated curl script result from HttpClient:
string curlResult = httpClientInstance.GenerateCurlInString(httpRequestMessage);httpClientInstance.GenerateCurlInConsole(httpRequestMessage);httpClientInstance.GenerateCurlInFile(httpRequestMessage);Additionally, there is another overload option for adding everything as plain:
httpClientInstance.GenerateCurlInString(yourHttpMethod, "yourRequestUri", "yourHeader", "yourContent");You have 3 Quick ways to see the generated curl script result from HttpRequestMessage:
string curlResult = httpRequestMessageInstance.GenerateCurlInString(new Uri("http://localhost:1213/v1/"));httpRequestMessageInstance.GenerateCurlInConsole(new Uri("http://localhost:1213/v1/"));httpRequestMessageInstance.GenerateCurlInFile(new Uri("http://localhost:1213/v1/"));HttpClientToCurl Document