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');
?>
Caching (Previous) References (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.