|
@@ -87,12 +87,19 @@ class Webservice
|
|
|
/**
|
|
|
* @param string $url
|
|
|
* @param string $method
|
|
|
+ * @param array $data
|
|
|
*
|
|
|
* @return HttpResponse
|
|
|
*/
|
|
|
- public function makeRequest($url, $method = HttpRequestInterface::METHOD_GET)
|
|
|
+ public function makeRequest($url, $method = HttpRequestInterface::METHOD_GET, $data = array())
|
|
|
{
|
|
|
$request = new HttpRequest($method, $url);
|
|
|
+ $headers = array();
|
|
|
+ if (!empty($data)) {
|
|
|
+ $headers[] = 'Content-Type: application/x-www-form-urlencoded';
|
|
|
+ $request->setContent(http_build_query($data));
|
|
|
+ }
|
|
|
+ $request->setHeaders($headers);
|
|
|
$response = new HttpResponse();
|
|
|
$this->httpClient->send($request, $response);
|
|
|
|