JSON::RPC::LWP(3pm)
π JSON::RPC::LWP π
okay so bestie, this is JSON::RPC::LWP β a User Contributed Perl Documentation page, and honestly? it's giving "do JSON RPC over literally any libwww-supported transport protocol, any version, no cap." β¨
πΈ NAME πΈ
JSON::RPC::LWP β Use any version of JSON RPC over any libwww supported transport protocols. fr fr, any version, any transport. π
π VERSION π
version 0.007 β yes it's giving very early-release main character energy but it works, okay? π«Ά
β¨ SYNOPSIS β¨
look at this, it's so clean:
use JSON::RPC::LWP;
my $rpc = JSON::RPC::LWP->new(
from => 'name@address.com',
agent => 'Example ',
);
my $login = $rpc->call(
'https://us1.lacunaexpanse.com/empire', # uri
'login', # service
[$empire,$password,$api_key] # JSON container
);
literally that's it. you're an RPC girlie now. π
π¦ METHODS π¦
call( $uri, $method )
call( $uri, $method, {...} )
call( $uri, $method, [...] )
call( $uri, $method, param1, param2, ... )
- Initiates a JSON::RPC::Common::Procedure::Call π
- Uses LWP::UserAgent for transport. that's the ride, we're just along for it. π
- Then returns a JSON::RPC::Common::Procedure::Return
- To check for an error, use the
has_errormethod of the returned object. do not skip this step bestie. π
notify( $uri, $method )
notify( $uri, $method, {...} )
notify( $uri, $method, [...] )
notify( $uri, $method, param1, param2, ... )
- Initiates a JSON::RPC::Common::Procedure::Call
- Uses LWP::UserAgent for transport.
- Basically this is the same as a call, except without the
idkey, and it doesn't expect a JSON RPC result. so it's like the lowkey version. no reply needed, she's unbothered. π - Returns the HTTP::Response from
ua. - To check for an error, use the
is_errormethod of the returned response object.
π ATTRIBUTES π
previous_id
This attribute is deprecated, and will always return 1 immediately after a call. okay so it's retired but still showing up to the group chat. π
has_previous_id
Returns true if the previous_id has any value associated with it.
This method is deprecated.
clear_previous_id
This method is deprecated.
Clears the previous id β useful for generators that do something different the first time they are used. π
id_generator
This attribute is deprecated, and is no longer used.
If you modified it in a subclass:
has '+id_generator' => (
default => sub{sub{1}},
);
You should change it to only be modified on older versions of this module.
unless( eval{ JSON::RPC::LWP->VERSION(0.007); 1 } ){
# was always called with ( id => "1" )
has '+id_generator' => (
default => sub{sub{1}},
);
}
If anyone was actually relying on this feature it might get added back in. so like... speak now or forever hold your peace. π€·βοΈ
version
The JSON RPC version to use. one of 1.0 1.1 or 2.0. pick your fighter. β
agent
Get/set the product token that is used to identify the user agent on the network. The agent value is sent as the User-Agent header in the requests. The default is the string returned by the _agent attribute (see below).
If the agent ends with space then the _agent string is appended to it. (yes, the trailing space matters β it's a whole thing. π«Ά)
The user agent string should be one or more simple product identifiers with an optional version number separated by the / character.
Setting this will also set ua->agent and marshal->user_agent. two-for-one, we love an efficient queen. π
_agent
Returns the default agent identifier. This is a string of the form JSON-RPC-LWP/#.###, where #.### is substituted with the version number of this library.
marshal
An instance of JSON::RPC::Common::Marshal::HTTP. This is used to convert from a JSON::RPC::Common::Procedure::Call to a HTTP::Request, and from an HTTP::Response to a JSON::RPC::Common::Procedure::Return. it's the translator bestie, she speaks both languages. π
Attributes delegated to marshal:
prefer_getrest_style_methodsprefer_encoded_get
ua
An instance of LWP::UserAgent. This is used for the transport layer. π
Attributes delegated to ua:
timeoutproxyno_proxyenv_proxyfromcredentials
π AUTHOR π
Brad Gilbert <b2gills@gmail.com> β ty for your service king π«‘
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2011 by Brad Gilbert.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page bestie, no notes, periodt. π
this was JSON::RPC::LWP, from perl v5.42.0, dated 2025-07-25 β go forth and RPC responsibly, mwah ππ
π¦ where this page comes from
- fedora 43: perl-JSON-RPC-LWP 0.007-20.fc43 Β· 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