JSON::...ion_1_1(3pm)

πŸ“¦
version 0.11 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

🌸 NAME 🌸

JSON::RPC::Common::Procedure::Call::Version_1_1 β€” bestie, it's the JSON-RPC 1.1 Procedure Call class. That's the whole vibe. πŸ’…


✨ VERSION ✨

version 0.11 πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's the whole thing in action:

use JSON::RPC::Common::Procedure::Call;

my $req = JSON::RPC::Common::Procedure::Call->inflate({
        version => "1.1",
        id      => "oink",
        params  => { foo => "bar" },
});

no cap, that's it. inflate and you're off 🫢


πŸ’– DESCRIPTION πŸ’–

so this class implements JSON-RPC 1.1 Procedure Calls according to the 1.1 working draft, which lives right here: http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html. iconic. πŸ‘‘

JSON RPC 1.1 requests are <b>never</b> notifications β€” like, never ever β€” and they accept either hash references or array references as parameters. both. your choice. slay. 🌈

ngl, there's a plot twist: the alternative JSON RPC 1.1 proposition is <b>also</b> supported, over at http://groups.google.com/group/json-rpc/web/json-rpc-1-1-alt ✨

the way that works is: kwparams is accepted as an alias to params, but params will also accept hash references. but β€” and this is the important part, bestie, don't skip it β€” params and kwparams are mutually exclusive, because Perl doesn't have strong support for named params. so pick one. literally one. πŸ’€

and listen, the alternative spec doesn't offer notifications (it's a TODO item, they're getting to it, it's giving very much "we'll do it later"), so currently is_notification <b>always returns false</b>. always. no exceptions. 🫢


πŸ‘‘ AUTHOR πŸ‘‘

Yuval Kogman <nothingmuch@woobling.org> β€” shoutout to the main character πŸ’œ


This software is copyright (c) 2014 by Yuval Kogman and others.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. periodt. πŸ’…


okay that's the whole page, ty for coming to my ted talk β€” this was perl v5.30.3, dated 2020-06-23, and it ate. no crumbs. bye bestie πŸ¦‹βœ¨

πŸ“¦ where this page comes from