Utility class for connecting to a REST API
internal | |
---|---|
package |
NextEvent\PHPSDK\REST |
__construct(\GuzzleHttp\Client $httpClient, \Psr\Log\LoggerInterface $logger = null)
Wraps HTTP client adding REST-specific headers and handling response or errors.
\GuzzleHttp\Client
\Psr\Log\LoggerInterface
optional logger
delete(string $url, string $authorizationHeader = null) : boolean
Throws |
|
---|
string
string
boolean
success
get(string $url, string $authorizationHeader = null) : \NextEvent\PHPSDK\Model\HALResponse
Throws |
|
---|
string
string
\NextEvent\PHPSDK\Model\HALResponse
patch(string $url, array $payload, string $authorizationHeader = null) : \NextEvent\PHPSDK\Model\HALResponse
Throws |
|
---|
string
request url
array
send payload as json
string
optional, authorizationHeader
\NextEvent\PHPSDK\Model\HALResponse
post(string $url, array $payload = null, string $authorizationHeader = null) : \NextEvent\PHPSDK\Model\HALResponse
Throws |
|
---|
string
request url
array
optional, send payload as json
string
optional, authorizationHeader
\NextEvent\PHPSDK\Model\HALResponse
put(string $url, array $payload, string $authorizationHeader = null) : \NextEvent\PHPSDK\Model\HALResponse
Throws |
|
---|
string
request url
array
send payload as json
string
optional, authorizationHeader
\NextEvent\PHPSDK\Model\HALResponse
setAuthorizationHeader(string $header) : self
string
self