cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: JSON is not well formed

From: Claes Jakobsson <claes_at_surfar.nu>
Date: Tue, 30 Jul 2013 10:12:53 +0200

On 2013-07-29 16:52, conversions_at_q2q.us wrote:
> I am running on windows using a batch file and I get an error message
> that
>
> JSON is not well formed.
>
> The JSON validates OK.
>
> Attached is the batch file and a trace file.
>
> Does anyone see what I need to change?

Looking at your trace file and BAT it seems the your shell eats up those
double quotes within single quotes.. It's not cURLs fault but rather
your shell that is being stupid.

See this section in the trace file:

   => Send data, 310 bytes (0x136)
   0000: '{intent:sale,payer:{payment_method:credit_card,funding_instrume
   0040: nts:[{credit_card:{number:5500005555555559,type:mastercard,expir
   0080: e_month:12,expire_year:2018,cvv2:111,first_name:Joe,last_name:Sh
   00c0: opper}}]},transactions:[{amount:{total:7.47,currency:USD},descri
   0100: ption:This is the payment transaction description.}]}'

The missing " makes it invalid JSON.

Cheers
claes

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-07-30