HttpInterface

interface DreamCommerce\ShopAppstoreLib\HttpInterface

Interface specifying methods for HTTP communication layer.

Each of implemented methods returns following data set:

array(
    'headers' => (
        'Content-Type' => 'application/json'
    ),
    'data' => <\ArrayObject|string>
)

methods

DreamCommerce\ShopAppstoreLib\HttpInterface::getLogger()

Get bound LoggerInterface` instance.

Return type:LoggerInterface|null
DreamCommerce\ShopAppstoreLib\HttpInterface::setLogger(LoggerInterface $logger)

Set LoggerInterface` for this client.

Parameters:
  • $logger (LoggerInterface) – instance
DreamCommerce\ShopAppstoreLib\HttpInterface::delete($url[, $query = array()[, $headers = array()]])

Performs HTTP DELETE.

Parameters:
  • $url (string) – URL
  • $query (array) – query parameters (URL query string, after question mark)
  • $headers (array) – additional headers to sent within request
Return type:

array

Returns:

see: structure

DreamCommerce\ShopAppstoreLib\HttpInterface::head($url[, $query = array()[, $headers = array()]])

Performs HTTP HEAD.

Parameters:
  • $url (string) – URL
  • $query (array) – query parameters (URL query string, after question mark)
  • $headers (array) – additional headers to sent within request
Return type:

array

Returns:

see: structure

DreamCommerce\ShopAppstoreLib\HttpInterface::get($url[, $query = array()[, $headers = array()]])

Performs HTTP GET.

Parameters:
  • $url (string) – URL
  • $query (array) – query parameters (URL query string, after question mark)
  • $headers (array) – additional headers to sent within request
Return type:

array

Returns:

see: structure

DreamCommerce\ShopAppstoreLib\HttpInterface::post($url[, $body = array()[, $query = array()[, $headers = array()]]])

Performs HTTP POST.

Parameters:
  • $url (string) – URL
  • $body (string) – request body
  • $query (array) – query parameters (URL query string, after question mark)
  • $headers (array) – additional headers to sent within request
Return type:

mixed

Returns:

see: structure

DreamCommerce\ShopAppstoreLib\HttpInterface::put($url[, $body = array()[, $query = array()[, $headers = array()]]])

Performs HTTP PUT.

Parameters:
  • $url (string) – URL
  • $body (string) – request body
  • $query (array) – query parameters (URL query string, after question mark)
  • $headers (array) – additional headers to sent within request
Return type:

mixed

Returns:

see: structure

DreamCommerce\ShopAppstoreLib\HttpInterface::getLogger()

Get bound LoggerInterface` instance.

Return type:LoggerInterface|null
DreamCommerce\ShopAppstoreLib\HttpInterface::setLogger(LoggerInterface $logger)

Set LoggerInterface` for this client.

Parameters:
  • $logger (LoggerInterface) – instance