123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <?php
- namespace TencentCloud\Common\Profile;
- class HttpProfile
- {
-
- public static $REQ_HTTPS = "https://";
-
- public static $REQ_HTTP = "http://";
-
- public static $REQ_POST = "POST";
-
- public static $REQ_GET = "GET";
-
- public static $TM_MINUTE = 60;
-
- private $reqMethod;
-
- private $endpoint;
-
- private $reqTimeout;
-
- private $protocol;
-
- private $proxy;
-
- private $rootDomain;
-
- private $keepAlive;
-
- public function __construct($protocol = null, $endpoint = null, $reqMethod = null, $reqTimeout = null)
- {
- $this->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;
- }
-
- public function setReqMethod($reqMethod)
- {
- $this->reqMethod = $reqMethod;
- }
-
- public function setProtocol($protocol) {
- $this->protocol = $protocol;
- }
-
- public function setEndpoint($endpoint)
- {
- $this->endpoint = $endpoint;
- }
-
- public function setReqTimeout($reqTimeout)
- {
- $this->reqTimeout = $reqTimeout;
- }
-
- public function setProxy($proxy)
- {
- $this->proxy = $proxy;
- }
-
- public function getReqMethod()
- {
- return $this->reqMethod;
- }
-
- public function getProtocol()
- {
- return $this->protocol;
- }
-
- public function getReqTimeout()
- {
- return $this->reqTimeout;
- }
-
- public function getEndpoint()
- {
- return $this->endpoint;
- }
-
- public function getProxy()
- {
- return $this->proxy;
- }
- public function setRootDomain($domain)
- {
- $this->rootDomain = $domain;
- }
- public function getRootDomain()
- {
- return $this->rootDomain;
- }
-
- public function setKeepAlive($flag) {
- $this->keepAlive = $flag;
- }
- public function getKeepAlive() {
- return $this->keepAlive;
- }
- }
|