- First commit of Negundo
This commit is contained in:
commit
69ed176b1c
18 files changed
+846
No files matched your search
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Negundo\Client\Transport;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
|
||||
class GuzzleClient implements TransportInterface {
|
||||
|
||||
public int $timeout = 1;
|
||||
|
||||
public bool $throwErrors = false;
|
||||
|
||||
public array $headers = [];
|
||||
|
||||
public function push(string $url, array $data) : ? object
|
||||
{
|
||||
return ( new Client([
|
||||
'timeout' => $this->timeout,
|
||||
]) )->post($url, [
|
||||
'form_params' => $data,
|
||||
'http_errors' => $this->throwErrors,
|
||||
'headers' => $this->headers,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user