Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for specifying the HTTP method #11

Closed
ecampidoglio opened this issue Dec 8, 2017 · 1 comment
Closed

Add support for specifying the HTTP method #11

ecampidoglio opened this issue Dec 8, 2017 · 1 comment

Comments

@ecampidoglio
Copy link
Member

ecampidoglio commented Dec 8, 2017

Generally speaking, it's better to use specialized arguments to create the right kind of request rather than manually specifying the HTTP method.

This guideline is clearly stated in curl's man page:

Normally you don't need this option. All sorts of GET, HEAD, POST and PUT requests are rather invoked by using dedicated command line options.

Nonetheless, there may be situations where a remote endpoint supports a different method than the one chosen by a given curl option.

For example, when you upload a file to an HTTP endpoint using the -T parameter, curl will by default issue a PUT request. Now, that won't work if the endpoint only supports POST. In those situations, you must be able to specify the HTTP method using the -X option:

curl -X POST -T file.txt http://host/path

It would be nice if CurlSettings supported the -X --request option directly.

@ecampidoglio
Copy link
Member Author

Resolved in the 2.1.0 release. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant