forked from loafle/openapi-generator-original
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -167,6 +167,13 @@ class Configuration
|
||||
*/
|
||||
protected $proxyPassword;
|
||||
|
||||
/**
|
||||
* Allow Curl encoding header
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $allowEncoding = false;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -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
|
||||
*
|
||||
@@ -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
|
||||
|
||||
@@ -167,7 +167,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);
|
||||
|
||||
@@ -199,6 +199,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);
|
||||
|
||||
@@ -177,6 +177,13 @@ class Configuration
|
||||
*/
|
||||
protected $proxyPassword;
|
||||
|
||||
/**
|
||||
* Allow Curl encoding header
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $allowEncoding = false;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -445,6 +452,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
|
||||
*
|
||||
@@ -455,6 +472,15 @@ class Configuration
|
||||
return $this->curlConnectTimeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get whether to allow encoding
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getAllowEncoding()
|
||||
{
|
||||
return $this->allowEncoding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HTTP Proxy Host
|
||||
|
||||
Reference in New Issue
Block a user