Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class ApiClient
if ($this->config->getCurlConnectTimeout() != 0) {
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $this->config->getCurlConnectTimeout());
}

// return the result on success, rather than just true
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

Expand Down Expand Up @@ -189,6 +189,10 @@ class ApiClient
$url = ($url . '?' . http_build_query($queryParams));
}

if ($this->config->getAllowEncoding()) {
curl_setopt($curl, CURLOPT_ENCODING, '');
}

if ($method === self::$POST) {
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ class Configuration
*/
protected $proxyPassword;

/**
* Allow Curl encoding header
*
* @var bool
*/
protected $allowEncoding = false;

/**
* Constructor
*/
Expand Down Expand Up @@ -435,6 +442,16 @@ class Configuration
return $this;
}

/**
* Set whether to accept encoding
* @param bool $allowEncoding
*/
public function setAllowEncoding($allowEncoding)
{
$this->allowEncoding = $allowEncoding;
return $this;
}

/**
* Gets the HTTP connect timeout value
*
Expand All @@ -445,6 +462,15 @@ class Configuration
return $this->curlConnectTimeout;
}

/**
* Get whether to allow encoding
*
* @return bool
*/
public function getAllowEncoding()
{
return $this->allowEncoding;
}

/**
* Sets the HTTP Proxy Host
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function callApi($resourcePath, $method, $queryParams, $postData, $header
if ($this->config->getCurlConnectTimeout() != 0) {
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $this->config->getCurlConnectTimeout());
}

// return the result on success, rather than just true
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

Expand Down Expand Up @@ -199,6 +199,10 @@ public function callApi($resourcePath, $method, $queryParams, $postData, $header
$url = ($url . '?' . http_build_query($queryParams));
}

if ($this->config->getAllowEncoding()) {
curl_setopt($curl, CURLOPT_ENCODING, '');
}

if ($method === self::$POST) {
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ class Configuration
*/
protected $proxyPassword;

/**
* Allow Curl encoding header
*
* @var bool
*/
protected $allowEncoding = false;

/**
* Constructor
*/
Expand Down Expand Up @@ -445,6 +452,16 @@ public function setCurlConnectTimeout($seconds)
return $this;
}

/**
* Set whether to accept encoding
* @param bool $allowEncoding
*/
public function setAllowEncoding($allowEncoding)
{
$this->allowEncoding = $allowEncoding;
return $this;
}

/**
* Gets the HTTP connect timeout value
*
Expand All @@ -455,6 +472,15 @@ public function getCurlConnectTimeout()
return $this->curlConnectTimeout;
}

/**
* Get whether to allow encoding
*
* @return bool
*/
public function getAllowEncoding()
{
return $this->allowEncoding;
}

/**
* Sets the HTTP Proxy Host
Expand Down