Add PHP example for using the HTTP daemon in docs. (#61)

* Add PHP example for using the HTTP daemon in docs.

* Use procedural code for example snippet

* Remove this variable
This commit is contained in:
Stefan Blanke 2020-10-12 19:05:53 +02:00 committed by GitHub
parent 4a6200b055
commit 6ac1346fa9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,6 +86,22 @@ fetch("http://localhost:8080", requestOptions)
.then(result => console.log(result))
.catch(error => console.log('error', error));
```
* `PHP` (Symfony HttpClient)
```php
$httpClient = HttpClient::create();
$response = $httpClient->request('POST', 'http://localhost:8080', [
'headers' => [
'Content-Type' => 'application/xml',
],
'body' => fopen('/path/to/some.xml', 'r'),
]);
echo $response->getContent();
```
## Status codes
| code | description |
|-|-|