GithubHelp home page GithubHelp logo

Comments (12)

amingolmahalle avatar amingolmahalle commented on June 6, 2024 1

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: to indicate the compression method. Curl will then automatically decompress the data and save the uncompressed document.
This can reduce the amount of data transferred and improve the performance of the script. However, the server must support the compression algorithms that curl supports, such as deflate or gzip.
This will request a compressed response from the server and save the uncompressed document. If the server does not support compression or sends an unsupported encoding, curl will report an error.
In my opinion, It's better programmer to specify this option itself. we do not automatically add this option to the curl script. because we are just a curl script generator.
What is your opinion now?

from httpclienttocurlgenerator.

amingolmahalle avatar amingolmahalle commented on June 6, 2024

Thank you dear @kokoabim
I will check it.

from httpclienttocurlgenerator.

kokoabim avatar kokoabim commented on June 6, 2024

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".

from httpclienttocurlgenerator.

naeemaei avatar naeemaei commented on June 6, 2024

@kokoabim @amingolmahalle
We must note that this package has the task of converting HttpClientto 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.

from httpclienttocurlgenerator.

amingolmahalle avatar amingolmahalle commented on June 6, 2024

@kokoabim @amingolmahalle We must note that this package has the task of converting HttpClientto 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.

@naeemaei I agree with you. adding this ability as an input option is a great idea. @kokoabim What Do you think?

from httpclienttocurlgenerator.

kokoabim avatar kokoabim commented on June 6, 2024

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.

from httpclienttocurlgenerator.

kokoabim avatar kokoabim commented on June 6, 2024

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.

from httpclienttocurlgenerator.

kokoabim avatar kokoabim commented on June 6, 2024

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.

from httpclienttocurlgenerator.

amingolmahalle avatar amingolmahalle commented on June 6, 2024

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;
    });

from httpclienttocurlgenerator.

amingolmahalle avatar amingolmahalle commented on June 6, 2024

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.

from httpclienttocurlgenerator.

amingolmahalle avatar amingolmahalle commented on June 6, 2024

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. :)

from httpclienttocurlgenerator.

amingolmahalle avatar amingolmahalle commented on June 6, 2024

closed

from httpclienttocurlgenerator.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.