mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
Use procedural code for example snippet
This commit is contained in:
parent
a34302c88a
commit
362f895668
1 changed files with 8 additions and 20 deletions
|
|
@ -89,19 +89,8 @@ fetch("http://localhost:8080", requestOptions)
|
|||
|
||||
* `PHP` (Symfony HttpClient)
|
||||
```php
|
||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||
$httpClient = HttpClient::create();
|
||||
|
||||
class XrechnungValidator
|
||||
{
|
||||
private $httpClient;
|
||||
|
||||
public function __construct(HttpClientInterface $httpClient)
|
||||
{
|
||||
$this->httpClient = $httpClient;
|
||||
}
|
||||
|
||||
public function validate()
|
||||
{
|
||||
$response = $this->httpClient->request('POST', 'http://localhost:8080', [
|
||||
'headers' => [
|
||||
'Content-Type' => 'application/xml',
|
||||
|
|
@ -110,8 +99,7 @@ class XrechnungValidator
|
|||
]);
|
||||
|
||||
echo $response->getContent();
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Status codes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue