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

Include all header values #17

Closed kokoabim closed 6 months ago

kokoabim commented 7 months ago

When appending header values, use string.Join("; ", header.Value) instead to include all header values.

amingolmahalle commented 7 months ago

Please write more details about your issue. or write an example so that I understand what you mean. Thank you

kokoabim commented 7 months ago

Instead of using header.Value?.FirstOrDefault() on the following lines, use string.Join("; ", header.Value). Header values can have more than one value, e.q. Cookie, hence the type of HttpHeaders:

Sabermotamedi commented 7 months ago

Hello @amingolmahalle,

Thank you for your comment. I've received feedback from @kokoabim regarding the handling of header values in the code. The suggestion is to use string.Join("; ", header.Value) instead of header.Value?.FirstOrDefault() to accommodate cases where headers may have multiple values.

I'll make the necessary adjustments to the code to address this issue. Once the changes are complete, I'll create a pull request for your review.

If you have any specific preferences or additional considerations, please let me know.

Appreciate your attention to this matter.

amingolmahalle commented 7 months ago

Hello @Sabermotamedi. This issue is assigned to you. Thanks.