/** * Prepare a guzzle http request * * @param string $verb * @param url $url * @param array $data * @param bool $async * @return GuzzleHttp\Request */ protected function prepareRequest($verb, $url, array $data, $async = false) { if (version_compare(ClientInterface::VERSION, '6') === 1) { $options = ['form_params' => $data]; } else { $options = ['body' => $data]; } $options['future'] = $async; return $this->client->createRequest($verb, $url, $options); }