Custom HTTP adapters

By default, the HTTP(S) XRD files are loaded by XML_XRD internally using file_get_contents.

If you want to set custom HTTP request headers or modify redirection handling, you may use an own HTTP adapter that will be used to fetch the files:

<?php
require_once 'HTTP/Request2.php';
require_once 
'Net/WebFinger.php';

$req = new HTTP_Request2();
$req->setConfig('follow_redirects'true);//needed for full compatibility
$req->setHeader('User-Agent''MyApp 1.42');

$wf = new Net_WebFinger();
$wf->setHttpClient($req);
$react $wf->finger('foo@example.org');
?>