Closed kokoabim closed 4 months ago
Thank you dear @kokoabim I will check it.
Thank you dear @kokoabim for your attention to this issue.
I found, that the --compressed option is equivalent to adding the header Accept-Encoding: deflate, gzip, br to the request, which tells the server that the client can accept compressed data. The server can then choose one of the algorithms and send the compressed data with the header Content-Encoding:
I believe having on be default is convenient. I've seen cURL not decompress even with your referenced header. I see it many times. Having it on by default won't "hurt".
@kokoabim @amingolmahalle
We must note that this package has the task of converting HttpClient
to CURL
and should create exactly what the user client needs, even if the HTTP request has a problem.
I suggest that this item be added to the input option and the user can specify it.
@kokoabim @amingolmahalle We must note that this package has the task of converting
HttpClient
toCURL
and should create exactly what the user client needs, even if the HTTP request has a problem. I suggest that this item be added to the input option and the user can specify it.
@naeemaei I agree with you. adding this ability as an input option is a great idea. @kokoabim What Do you think?
I'm unfamiliar with the input options myself. Just as long as it's enabled it's fine. the code could be modified to autodetect the encoding and add the option regardless of input on the users end. I noticed the need as most the queries I use it for requires the switch. Either was is fine.
I've just in the past cloned the repository and modify the code myself. I had once or twice submitted a PR but was denied because I didn't have permission.
another thing that would be nice but it will not work on windows which it only works on linux and macOS is that after each command argument having a backwack ("\") and new line after it, so it's easier to read in the terminal but again for a windows user I don't think that that supported.
I'm unfamiliar with the input options myself. Just as long as it's enabled it's fine. the code could be modified to autodetect the encoding and add the option regardless of input on the users end. I noticed the need as most the queries I use it for requires the switch. Either was is fine.
The code below is a sample with option input. with the last of parameters, you can set configs for results to fit with the result type that you want to take. (Result type means: Put it in a string variable, Show to the IDE console, or Write in a file) For example, we can add config.CompressEnabled=true; to options.if the developer likes this config he/she can only set this option in the input config.
httpClient.GenerateCurlInConsole(
httpRequestMessage,
config =>
{
config.TurnOn = true;
config.NeedAddDefaultHeaders = true;
config.EnableCodeBeautification = false;
});
I've just in the past cloned the repository and modify the code myself. I had once or twice submitted a PR but was denied because I didn't have permission.
I haven't realized your problem with cloning the repository. If you get a fork of this repository then you can send your merge request. the pull request is open for all.
another thing that would be nice but it will not work on windows which it only works on linux and macOS is that after each command argument having a backwack ("") and new line after it, so it's easier to read in the terminal but again for a windows user I don't think that that supported.
We must have changes that all operation systems support dear @kokoabim.Our main aim is to keep all developers happy. :)
closed
Add the cURL
--compressed
command-line option to the outputted command-line by default. Most requests nowadays have compression encoding, i.e. the headerAccept-Encoding: gzip; deflate; br
.