zsh-users
 help / color / mirror / code / Atom feed
* Sending CURL requests through ZSH fails
@ 2014-10-19 11:48 Yazin
  2014-10-19 12:41 ` Clint Hepner
  0 siblings, 1 reply; 2+ messages in thread
From: Yazin @ 2014-10-19 11:48 UTC (permalink / raw)
  To: zsh-users

Hi,

I've got the following CURL request. Sending it through ZSH fails, while
sending it through the default Ubuntu shell (SH) works.

Command:
curl https://api.stripe.com/v1/charges \
   -u sk_test_123495219ba2f84566e63fca0535d343: \
   -d amount=10.500 \
   -d currency=usd \
   -d card[number]=4242424242424242 \
   -d card[exp_month]=11 \
   -d card[exp_year]=2014 \
   -d card[cvv]=123 \
   -d "description=Charge for test@example.com"

Expected output (the output I get from SH):
{
  "error": {
    "type": "invalid_request_error",
    "message": "Invalid API Key provided:
sk_test_****************************d343"
  }
}

Actual output (from ZSH):
zsh: no matches found: card[number]=4242424242424242


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Sending CURL requests through ZSH fails
  2014-10-19 11:48 Sending CURL requests through ZSH fails Yazin
@ 2014-10-19 12:41 ` Clint Hepner
  0 siblings, 0 replies; 2+ messages in thread
From: Clint Hepner @ 2014-10-19 12:41 UTC (permalink / raw)
  To: Yazin; +Cc: <zsh-users@zsh.org>

The brackets are interpreted as a glob which zsh attempts to expand to files in the current directory. You need to quote them, for example, 

      -d "card[cvv]=123" \

so that the brackets are passed literally to curl. 

--
Clint

> On Oct 19, 2014, at 7:48 AM, Yazin <i@yaz.in> wrote:
> 
> Hi,
> 
> I've got the following CURL request. Sending it through ZSH fails, while
> sending it through the default Ubuntu shell (SH) works.
> 
> Command:
> curl https://api.stripe.com/v1/charges \
>   -u sk_test_123495219ba2f84566e63fca0535d343: \
>   -d amount=10.500 \
>   -d currency=usd \
>   -d card[number]=4242424242424242 \
>   -d card[exp_month]=11 \
>   -d card[exp_year]=2014 \
>   -d card[cvv]=123 \
>   -d "description=Charge for test@example.com"
> 
> Expected output (the output I get from SH):
> {
>  "error": {
>    "type": "invalid_request_error",
>    "message": "Invalid API Key provided:
> sk_test_****************************d343"
>  }
> }
> 
> Actual output (from ZSH):
> zsh: no matches found: card[number]=4242424242424242


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-10-19 12:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-19 11:48 Sending CURL requests through ZSH fails Yazin
2014-10-19 12:41 ` Clint Hepner

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).