cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Aleksandar Lazic <al-curlusers_at_none.at>
Date: Mon, 31 Aug 2015 17:47:33 +0200

Am 30-08-2015 18:36, schrieb Daniel Stenberg:
> On Sun, 30 Aug 2015, Alex Bligh wrote:

>> 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,
>
> Then you're one of the persons I want to change! =)
>
> I don't think it is clear. I think it actually makes a disservice to
> the users reading that. First, I think it misleads the user into
> believing he or she needs to use -X when using curl to do these
> operaitons and secondly, it misleads the user into believing that the
> -X method is actually what tells curl how to act. Like they may then
> wrongly believe that curl would act differently if you did -XPOST or
> -XGET, when in fact curl doesn't care about what -X is set to, but it
> is the other option(s) that control how it behaves.

I full agree with you.
Every-time when I read -XGET I ask me why the user do this.

The only reason for me to use -X is if I need a request methode which is
not build in into curl as describe in the man page

http://curl.haxx.se/docs/manpage.html#-X

>> Making this look like an error just makes it harder to document things
>> using a curl command line as an example.
>
> I happen to think it is a mild error to use -X to set the same method
> curl would use anyway. Perhaps error is a too strong word, but I don't
> think it is the proper way to use curl.

Full ack.
I would go further and maike it as hard error, stop running, but this
could be to hard ;-)

> I'm still intersted in reading more opinions on the matter!

BR Aleks
-------------------------------------------------------------------
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-31