use Net::ICAP::Request;
use Net::ICAP::Common qw(:req);
$msg = new Net::ICAP::Request;
$rv = $msg->parse($fh);
$method = $msg->method;
$url = $msg->url;
$auth = $msg->authority;
$service = $msg->service;
$query = $msg->query;
$query_arg = $msg->query('lang');
$msg = Net::ICAP::Request->new(
method => ICAP_REQMOD,
url => $url,
headers => {
Host => 'localhost',
},
);
$rv = $msg->method(ICAP_RESPMOD);
$rv = $msg->url($url);
$rv = $msg->generate($fh);
$rv = $msg->method($method);
$method = $msg->method;
This method gets or sets the request method. Only valid methods are accepted and must be one of ICAP_REQMOD, ICAP_RESPMOD, or ICAP_OPTIONS. No provision exists at this moment to accept custom methods.
$rv = $msg->url($url);
$url = $msg->url;
This method gets or sets the URL the request is going to. No validation is done on the passed value.
$auth = $msg->authority;
This returns the hostname/port section of the URL, assuming one was set and is parseable by URI.
$service = $msg->service;
This returns the service (or path component of a URI) of the URL, assuming one was set and is parseable by URI.
$query = $msg->query;
$query_arg = $msg->query('lang');
This returns either the entire query string or the value of the specified query argument as defined in the URL. This uses query_form of URI which assumes query components use application/x-www-form-urlencoded format.
This method is used internally by both the parse and generate methods.
(c) 2012, Arthur Corliss (corliss@digitalmages.com)
Copyright © 1997 - 2016, Arthur Corliss, all rights reserved.