adding PHP example for custom HTTP headers in documentation + improving logs for custom HTTP headers

This commit is contained in:
Julien Neuhart
2019-12-09 16:50:08 +01:00
parent 2251267ae4
commit 126cdd73e4
16 changed files with 133 additions and 95 deletions

View File

@@ -128,4 +128,15 @@ $ curl --request POST \
### PHP
// TODO
```php
use TheCodingMachine\Gotenberg\Client;
use TheCodingMachine\Gotenberg\DocumentFactory;
use TheCodingMachine\Gotenberg\HTMLRequest;
$client = new Client('http://localhost:3000', new \Http\Adapter\Guzzle6\Client());
$index = DocumentFactory::makeFromPath('index.html', 'index.html');
$request = new HTMLRequest($index);
$request->setWebhookURL('http://myapp.com/webhook/');
$request->addWebhookURLHTTPHeader('Your-Header', 'Foo');
$resp = $client->post($request);
```