Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: JSON UTF-8

by hippo (Archbishop)
on May 09, 2024 at 14:12 UTC ( [id://11159358]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11159358]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-07-24 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.