-
Notifications
You must be signed in to change notification settings - Fork 8
examples
This is the place to come for more-than-API-docs. Check out the various sections to help with common tasks - and open an issue to share an example that isn't listed.
If you need any additional configuration of the HTTP connection, then you can supply a "client"
element to the constructor's array argument, and pass any \GuzzleHttp\ClientInterface
object to that. Check the documentation of Guzzle Request Options as all of these can also be passed in the constructor of the \GuzzleHttp\Client
.
<?php
require "vendor/autoload.php";
$client = new \GuzzleHttp\Client([
"base_uri" => "http://localhost:5984"
// set any other options here
]);
$server = new \PHPCouchDB\Server(["client" => $client]);
echo $server->getVersion();
First of all: open an issue so we know what you looked for and missed.
Then, use \PHPCouchDB\Server::getClient
to get the \GuzzleHTTP\Client
. Since CouchDB is a pure HTTP interface, you can use the client and the excellent Guzzle documentation to do whatever it is you need.