in reply to JSON encoding error

print "Content-type: application/json; charset=UTF-8\n\n";

FWIW, I never specify the charset= part when sending JSON because the RFC already specifies it must be UTF-8.

Here is a very cut-down version of my code to demonstrate the problem

Looks OK otherwise. Is this an actual data set you have tested with the integration?


🦛

Replies are listed 'Best First'.
Re^2: JSON UTF-8
by Bod (Parson) on May 09, 2024 at 14:41 UTC
    Looks OK otherwise

    Thank you hippo for that comment...

    Your faith in the integrity of it made me go and look again at the endpoint and the settings in Stripe. I found the error which is not what Stripe was making obvious. Digging a bit deeper I found that Stripe was also saying there was 302 redirection. The webhook endpoint in Stripe was subtly wrong causing a redirect which Stripe treats as an error.

    Clearly a "senior moment" on my part

Re^2: JSON UTF-8
by Bod (Parson) on May 09, 2024 at 14:16 UTC
    FWIW, I never specify the charset= part when sending JSON

    Niether do I!
    That was added after I got the error from Stripe...