It's better when it's simple

User Tools

Site Tools


Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community

Follow us on Facebook, Twitter and other social networks.

Our Privacy Policy


HTTPClient Library

DokuWiki provides a library to access remote web servers without the need for any special PHP library (like CURL) or unsafe PHP settings (like allow_url_fopen).

The following features are supported:

  • Communication directly via network sockets
  • SSL support (if enabled in PHP)
  • Configurable timeouts
  • Proxy support
  • Redirect following
  • HTTP header parser
  • Basic authentication
  • Chunked encoding

The client is implemented in the class HTTPClient, but it is recommended to access the library through the DokuHTTPClient subclass instead. This automatically configures the client correctly for using the proxy settings.


Simple GET

$http = new DokuHTTPClient();
$data = $http->get('');
echo $data;

Simple POST

// post data can be passed as associative array
$send = array(
    'p' => 'dokuwiki'
$http = new DokuHTTPClient();
$data = $http->post('', $send);
echo $data;
devel/httpclient.txt · Last modified: 2012-10-14 05:46 by Matt2