Comments (12)
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.
Thank you dear @kokoabim
I will check it.
from httpclienttocurlgenerator.
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.
@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.
from httpclienttocurlgenerator.
@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?
from httpclienttocurlgenerator.
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.
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.
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.
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.
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.
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.
closed
from httpclienttocurlgenerator.
Related Issues (19)
- Show more details in case of errors HOT 2
- Add fluent assertions to xml tests
- Add fluent assertions to json tests
- Why BaseUrl of HttpClient is mandatory? HOT 1
- Query params not escaped in url, resulting in invalid curl command. HOT 1
- Refactor Unit Tests to use xUnit Framework HOT 1
- Include all header values HOT 4
- 📝 Integrate EditorConfig for Code Consistency
- Proposal: Add Sample Projects for Better Documentation
- Quote the URL HOT 2
- Use readme.md file in nuget readme HOT 3
- Seperate Test and Source Folder HOT 1
- add pre-commit and pre-push files to curl generator HOT 2
- Adding tests for input config for different scenarios(show in the console, write in a file and put into string variable) HOT 2
- Exclude `Content-Length` from curl HOT 1
- Make NuGet package Strongly Named HOT 2
- Refactoring on the Readme file
- Changing the code of some classes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from httpclienttocurlgenerator.