XMLRPC:...rt::HTTP(3)
π NAME π
okay so bestie, welcome to the XMLRPC:...rt::HTTP(3) page from the User Contributed Perl Documentation β the actual module is XMLRPC::Transport::HTTP: Server/Client side HTTP support for XMLRPC::Lite. periodt. π
β¨ SYNOPSIS β¨
π§βπ» Client
use XMLRPC::Lite
proxy => 'http://localhost/',
# proxy => 'http://localhost/cgi-bin/xmlrpc.cgi', # local CGI server
# proxy => 'http://localhost/', # local daemon server
# proxy => 'http://login:password@localhost/cgi-bin/xmlrpc.cgi', # local CGI server with authentication
;
print getStateName(1);
π CGI server
use XMLRPC::Transport::HTTP;
my $server = XMLRPC::Transport::HTTP::CGI
-> dispatch_to('methodName')
-> handle
;
π°οΈ Daemon server
use XMLRPC::Transport::HTTP;
my $daemon = XMLRPC::Transport::HTTP::Daemon
-> new (LocalPort => 80)
-> dispatch_to('methodName')
;
print "Contact to XMLRPC server at ", $daemon->url, "\n";
$daemon->handle;
π¬ DESCRIPTION π¬
This class is literally the HTTP glue for a XMLRPC server β it encapsulates all HTTP related logic, independent of what web server it's attached to. If you wanna use this class, just follow the simple guideline mentioned above, bestie. π«Ά
π PROXY SETTINGS π
You can use any proxy setting you use with LWP::UserAgent modules:
XMLRPC::Lite->proxy('http://endpoint.server/',
proxy => ['http' => 'http://my.proxy.server']);
or
$xmlrpc->transport->proxy('http' => 'http://my.proxy.server');
should specify proxy server for you. And if you use HTTP_proxy_user and HTTP_proxy_pass for proxy authorization, SOAP::Lite should know how to handle it properly. π
πͺ COOKIE-BASED AUTHENTICATION πͺ
use HTTP::Cookies;
my $cookies = HTTP::Cookies->new(ignore_discard => 1);
# you may also add 'file' if you want to keep them between sessions
my $xmlrpc = XMLRPC::Lite->proxy('http://localhost/');
$xmlrpc->transport->cookie_jar($cookies);
Cookies will be taken from response and provided for request. You may always add another cookie (or extract what you need after response) with HTTP::Cookies interface.
You may also do it in one line:
$xmlrpc->proxy('http://localhost/',
cookie_jar => HTTP::Cookies->new(ignore_discard => 1));
ποΈ COMPRESSION ποΈ
XMLRPC::Lite provides you an option for enabling compression on the wire (for HTTP transport only). Both server and client should support this capability, but this logic should be absolutely transparent for your application.
Here's the tea: the server will respond with an encoded message only if the client can accept it β client sends Accept-Encoding with 'deflate' or '*' values β and the client has fallback logic. So if the server doesn't understand the specified encoding (Content-Encoding: deflate) and returns the proper error code (415 NOT ACCEPTABLE), the client will repeat the same request not encoded and will store this server in a per-session cache, so all other requests will go there without encoding. iconic fallback behavior, honestly β¨
Having options on client and server side that let you specify threshold for compression means you can safely enable this feature on both client and server side.
Compression will be enabled on client side IF:
- threshold is specified
- size of current message is bigger than threshold
- module
Compress::Zlibis available
Client will send header 'Accept-Encoding' with value 'deflate' if threshold is specified AND module Compress::Zlib is available.
Server will accept a compressed message if module Compress::Zlib is available, and will respond with a compressed message ONLY IF:
- threshold is specified
- size of current message is bigger than threshold
- module
Compress::Zlibis available - header
'Accept-Encoding'is presented in request
π¦ DEPENDENCIES π¦
Crypt::SSLeayβ for HTTPS/SSLHTTP::Daemonβ forXMLRPC::Transport::HTTP::DaemonApache,Apache::Constantsβ forXMLRPC::Transport::HTTP::Apache
π SEE ALSO π
- See
::CGI,::Daemonand::Apachefor implementation details. - See
examples/XMLRPC/*for examples.
Β©οΈ COPYRIGHT Β©οΈ
Copyright (C) 2000-2001 Paul Kulchenko. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
βοΈ AUTHOR βοΈ
Paul Kulchenko (paulclinger@yahoo.com)
π sign-off: this page is from perl v5.42.0, dated 2014-06-25, and the manual is XMLRPC:...rt::HTTP(3) β slay and hydrate, bestie π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: perl-XMLRPC-Lite 0.717-bp160.1.11 Β· GPL-1.0+ or Artistic-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms