reqMethod = $reqMethod ? $reqMethod : HttpProfile::$REQ_POST; $this->endpoint = $endpoint; $this->reqTimeout = $reqTimeout ? $reqTimeout : HttpProfile::$TM_MINUTE; $this->protocol = $protocol ? $protocol : HttpProfile::$REQ_HTTPS; $this->rootDomain = "tencentcloudapi.com"; $this->keepAlive = false; } /** * 设置http请求方法 * @param string $reqMethod http请求方法,目前支持POST GET */ public function setReqMethod($reqMethod) { $this->reqMethod = $reqMethod; } /** * 设置请求协议 * @param string $protocol 请求协议(https:// http://) */ public function setProtocol($protocol) { $this->protocol = $protocol; } /** * 设置请求接入点域名 * @param string $endpoint 请求接入点域名(xx.[region.]tencentcloudapi.com) */ public function setEndpoint($endpoint) { $this->endpoint = $endpoint; } /** * 设置请求超时时间 * @param integer $reqTimeout 请求超时时间,单位:s */ public function setReqTimeout($reqTimeout) { $this->reqTimeout = $reqTimeout; } /** * 设置请求代理 * @param string|array $proxy 请求代理配置 */ public function setProxy($proxy) { $this->proxy = $proxy; } /** * 获取请求方法 * @return null|string 请求方法 */ public function getReqMethod() { return $this->reqMethod; } /** * 获取请求协议 * @return null|string 请求协议 */ public function getProtocol() { return $this->protocol; } /** * 获取请求超时时间 * @return int 请求超时时间 */ public function getReqTimeout() { return $this->reqTimeout; } /** * 获取请求接入点域名 * @return null|string 接入点域名 */ public function getEndpoint() { return $this->endpoint; } /** * 获取请求代理 * @return null|string|array */ public function getProxy() { return $this->proxy; } public function setRootDomain($domain) { $this->rootDomain = $domain; } public function getRootDomain() { return $this->rootDomain; } /** * @param boolean $flag */ public function setKeepAlive($flag) { $this->keepAlive = $flag; } public function getKeepAlive() { return $this->keepAlive; } }