Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Sending CURL requests through ZSH fails



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@xxxxxx> 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@xxxxxxxxxxx"
> 
> 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



Messages sorted by: Reverse Date, Date, Thread, Author