spulec / uncurl

A library to convert curl requests to python-requests.
Apache License 2.0
615 stars 96 forks source link

Documentation should inform that it does not work for all curl commands, but works very well with Chrome Dev Tools #56

Open velle opened 1 year ago

velle commented 1 year ago

It appears that the tool was developed specifically for use in combination with "Copy as cURL" in Chrome Developer Tool. And it is a great tool for that :) I used it on many occasions.

This week I was planning/trying to use it for a different kind of problem. I wrote some cURL commands that access a webservice API, saved these as small shell scripts named 1.sh, 2.sh, etc., and verified that these worked. I then wanted to use these as templates. Let my Python script read the .sh files, parse them with uncurl, and make small adaptions before sending the request with the requests library.

But so far my experience is that uncurl is unable to handle most of the shell scripts I wrote. Eg. arguments like --cert and --key are not supported. Also uncurl cares more about the order of arguments than curl does.

It would be helpful if the documentation contained a "warning" that it should work for all (or most) of cURL commands that Chrome Dev Tool will produce, but can not be expected to work with any curl command. And a very rough overview of what is supported and what is not.

If you have any interest in this, I could write my suggestion for a short paragraph about this, and post as a comment to this issue? (I have not yet learned how to do pull requests and actually contribute to repos)

Sincerely :)