amingolmahalle / HttpClientToCurlGenerator

The HttpClientToCurl is a NuGet package for generating curl script of HttpClient in .NET ( C# | CSharp | Dotnet ) supported features: Post, Get, Put, and Delete. content types: application/json, text/xml, application/x-www-form-urlencoded
https://www.nuget.org/packages/HttpClientToCurl
MIT License
51 stars 11 forks source link

Exclude `Content-Length` from curl #38

Closed naeemaei closed 3 months ago

naeemaei commented 3 months ago

The output curl shouldn't include the Content-Length header, this header computes automatically.

Example:

curl -X POST 'http://localhost:8090/v1/api/test' -H 'Authorization: Bearer f69406a4-6b62-4734-a8dc-158f0fc308ab' -H 'Content-Type: application/json; charset=utf-8' -H 'Content-Length: 214' -d '{"name":"test","requestId":7000,"amount":9000000}' 
amingolmahalle commented 3 months ago

closed