curl / Mailing Lists / curl-users / Single Mail

curl-users

Curl on Windows has issues with JSON parameters on command line?

From: Ayotunde Itayemi <aitayemi_at_gmail.com>
Date: Fri, 11 May 2018 00:33:14 -0600

Hi All,
New to the list. I have been testing various Windows build of curl (7.42,
7.53, 7.59, 7.55 on cygwin) but none seems to work well when the
credentials are supplied in JSON form on the command line (they do work if
you put the JSON credentials in a file and then supply it to curl using the
form @filename).

Sample command that fails with response {"message": "Bad Request"}:

curl -i -X POST -H "Content-Type: application/json" -d
'{"user":"/domain-name/firstname.lastname_at_domain.com","password":"some-password"}'
https://server-name-fqdn/resource-or-service

The same command succeeds if I store the credentials in JSON format in a
file and then execute:

curl -i -X POST -H "Content-Type: application/json" -d @file
https://server-name-fqdn/resource-or-service

In contrast 7.29.0 (and 7.59) on Linux works fine. For some reason curl on
cygwin won't connect at all and keeps giving "connection timed out." Is it
something Windows is doing to the parameters (thinking parameter expansion)
or some other issue that's actual just peculiar to the Windows version of
curl?

Regards,

Ayotunde

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-05-11