-
Notifications
You must be signed in to change notification settings - Fork 17
GetStarted
It’s easy to use HttpClientToCurl!
You just 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 get curl from HttpClient or HttpRequestMessage in .Net below:
You have 3 Quick ways to see the generated curl script result from HttpClient:
string curlScript = httpClientInstance.GenerateCurlInString(httpRequestMessage);httpClientInstance.GenerateCurlInConsole(httpRequestMessage);Notice: when the curl script was written in the console, maybe your IDE console applies WordWrap automatically. you should remove enters from the script.
Notice: You can set specific configurations for your result in the optional second parameter.
httpClientInstance.GenerateCurlInFile(httpRequestMessage);Notice: You can set specific configurations for your result using the optional second parameter.
You have 3 Quick ways to see the generated curl script result from HttpRequestMessage:
string curlResult = httpRequestMessage.GenerateCurlInString(new Uri("http://localhost:1213/v1/"));httpRequestMessage.GenerateCurlInConsole(new Uri("http://localhost:1213/v1/"));Notice: when the curl script was written in the console, maybe your IDE console applies WordWrap automatically. you should remove enters from the script.
Notice: You can set specific configurations for your result in the optional second parameter.
httpRequestMessage.GenerateCurlInFile(new Uri("http://localhost:1213/v1/"));Notice: You can set specific configurations for your result using the optional second parameter.
HttpClientToCurl Document