Plack::...::JSONP(3)
π Plack::Middleware::JSONP β bestie's guide to wrapping JSON in JSONP π
okay so real talk: this is Plack::Middleware::JSONP(3), straight out of the User Contributed Perl Documentation, and it's literally the glow-up your JSON API has been begging for. Wraps JSON response in JSONP if callback parameter is specified. That's the whole vibe. π
β¨ NAME β¨
Plack::Middleware::JSONP β wraps a JSON response in JSONP when the callback parameter shows up. no cap, that's it, that's the girl πΈ
π¦ SYNOPSIS π¦
enable "JSONP", callback_key => 'jsonp';
one line. she's minimal, she's iconic, she ate π
π DESCRIPTION π
So here's the tea, bestie: Plack::Middleware::JSONP grabs a JSON response β and by "JSON response" we mean one whose Content-Type value is either text/javascript or application/json β and wraps it up as a JSONP response instead. Which one does it become? The one that's specified with the callback query parameter. β¨
And the way that you get to name that parameter yourself? You set it while enabling the middleware. Your middleware, your rules, your main character energy π
One (1) very important caveat though, and I need you to hear me on this: this middleware only works with a non-streaming response. Streaming? Not it. And other than that whole wrapping situation, it doesn't touch the response otherwise β it minds its own business, fr fr. π«Ά
π AUTHOR π
Tatsuhiko Miyagawa β the icon, the legend, the blueprint ππ
π SEE ALSO π
Plackβ go read it, iykyk π
and that's a wrap, gorgeous β¨ this whole thing came to you from perl v5.42.3, dated 2026-10-18, filed under Plack::...::JSONP(3) β mwah, go ship it π
ππ¦
π¦ where this page comes from
- fedora 43: perl-Plack 1.0055-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-Plack 1.0055-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms