PHP code example of nathan242 / php-icap-client
1. Go to this page and download the library: Download nathan242/php-icap-client library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nathan242 / php-icap-client example snippets
$icap = new IcapClient('127.0.0.1', 13440);
$icap->options('example');
$icap->reqmod(
'example',
[
'req-hdr' => "POST /test HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n",
'req-body' => 'This is another test.'
]
);
$icap->respmod(
'example',
[
'res-hdr' => "HTTP/1.1 200 OK\r\nServer: Test/0.0.1\r\nContent-Type: text/html\r\n\r\n",
'res-body' => 'This is a test.'
]
);