cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: A small nudge to fix a frequent -X misuse?

From: Alex Bligh <alex_at_alex.org.uk>
Date: Sun, 30 Aug 2015 12:35:46 +0100

On 29 Aug 2015, at 23:08, Daniel Stenberg <daniel_at_haxx.se> wrote:

> I see lots and lots of curl suggestions and examples on the internet use -X where it isn't needed. Like -XGET for an ordinary URL or using -d data -XPOST and so on. Just superfluous uses of -X that annoy me (possibly slightly more than I can really motivate).

...

> Thoughts?

Please do not do this or only do this in verbose mode. It isn't as if the default is always GET. The default changes according to other parameters (e.g. presence of -d). Given that, if I'm documenting a JSON call in curl, I'll *always* specify -XGET or -X POST (or whatever), so it's clear, particularly to people unfamiliar with curl, exactly what it's doing. Making this look like an error just makes it harder to document things using a curl command line as an example.

-- 
Alex Bligh
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2015-08-30