derekkraan / curl_req

req to curl and back
https://hex.pm/packages/curl_req
MIT License
38 stars 2 forks source link

Support short and long flags in `to_curl/2` #8

Closed kevinschweikert closed 1 week ago

kevinschweikert commented 3 weeks ago

When we generate the curl command we currently only use the short flags. It would be nice to let the user choose if they want the short form or the long form.

Something like:

req |> to_curl(flags: :long)
"curl --request GET example.com"

# by default it uses the short flags
req |> to_curl()
"curl -X GET example.com"

# would be the same as
req |> to_curl(flags: :short)
"curl -X GET example.com"
derekkraan commented 1 week ago

I am also in agreement here and would accept a PR that implements this feature.