laravel-shift / curl-converter

Online tool to convert `curl` requests to Laravel `Http` requests
MIT License
88 stars 10 forks source link

Add support for more options #12

Closed dnkmdg closed 2 years ago

dnkmdg commented 2 years ago

When copying request from Chrome DevTools the options --insecure and --compressed are sometimes present, and was not recognized by the package.

The --insecure option should primarily be present when posting/fetching data from a non-SSL endpoint. The --compressed option indicates that cURL accepts any encoded response, equivalent to CURLOPT_ENCODING = ""

I added support for these two in the options gatherer. They won't have any effect on the standard HTTP call, thus are simply ignored.

Removed notes about #8

jasonmccreary commented 2 years ago

Thanks. A few things:

dnkmdg commented 2 years ago

Agreed on separate PRs, figured I'd include them both since they don't really affect anything outside of CurlCommand::class. I can remove the --data-raw-part and put in a separate PR.

There are tests however, both fixtures are available as with-compressed-option and with-insecure-option. Or should there be any more specific tests?

jasonmccreary commented 2 years ago

Thanks. If you can remove the left over data-raw fixtures from this PR, I'll get it merged.