curl / Mailing Lists / curl-users / Single Mail


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

From: Daniel Stenberg <>
Date: Fri, 11 May 2018 10:55:50 +0200 (CEST)

On Fri, 11 May 2018, Ayotunde Itayemi wrote:

> 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).

Then I'd suggest you add "--trace-ascii log.txt" to both command lines and
compare the logged data and see how they differ in what curl sends.

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

I strongly advice you to drop the "-X POST" from the command line. That's
almost never the right thing to use, especially not when you use -d already.

> In contrast 7.29.0 (and 7.59) on Linux works fine.

I guess the difference is because of different behaviors in the shells. Like
regular windows command prompts don't support single quotes etc.

> For some reason curl on cygwin won't connect at all and keeps giving
> "connection timed out."

I don't think that's the common experience for curl users on cygwin, since
this is the first time I hear of this. But I'm not sure, maybe we don't have
that many users on cygwin anymore so this issue has just flew under the radar?

Received on 2018-05-11