src/curlient/Curlient.php
public function request($url, $method = 'get', $postFields = []) {
		if (!$this->curl || !$url) {
			return $this;
		}
		$this->content = '';
		unset($this->header['X-Requested-With']);
		$this->host = parse_url($url, PHP_URL_HOST);
		$hosts      = explode('.', $this->host);
		if (count($hosts) > 2) {
			$this->host = implode('.', array_slice($hosts, 1));
		}
		// 自定义cookie
		if ($this->cookie) {
			$cookie = $this->cookie;
		}
		// 从上一次请求读取的cookie
		if ($this->host && isset(self::$cookies[ $this->host ])) {
			$cookie = isset($cookie) ? array_merge(self::$cookies[ $this->host ], $cookie) : self::$cookies[ $this->host ];
		}
		// 设置cookie
		if (isset($cookie)) {
			$cookie = $this->ary_kv_concat($cookie);
			curl_setopt($this->curl, CURLOPT_COOKIE, $cookie);
		}
		//自动设置referer
		if ($this->referer) {
			curl_setopt($this->curl, CURLOPT_REFERER, $this->referer);
		}
		//清空PostData
		curl_setopt($this->curl, CURLOPT_POSTFIELDS, '');
		//设置请求方法
		if ($method == 'get') {
			curl_setopt($this->curl, CURLOPT_HTTPGET, 1);
			curl_setopt($this->curl, CURLOPT_POST, 0);
		} else {
			curl_setopt($this->curl, CURLOPT_HTTPGET, 0);
			curl_setopt($this->curl, CURLOPT_POST, 1);
			//提交字段
			if ($postFields) {
				curl_setopt($this->curl, CURLOPT_POSTFIELDS, $postFields);
			}
		}
		curl_setopt($this->curl, CURLOPT_URL, $this->buildURL($url));
		$this->referer = $url;
		$this->ready   = true;
		$this->url     = $url;

		return $this;
	}
public function request($url, $method = 'get', $postFields = []) {
		if (!$this->curl || !$url) {
			return $this;
		}
		$this->content = '';
		unset($this->header['X-Requested-With']);
		$this->host = parse_url($url, PHP_URL_HOST);
		$hosts      = explode('.', $this->host);
		if (count($hosts) > 2) {
			$this->host = implode('.', array_slice($hosts, 1));
		}
		// 自定义cookie
		if ($this->cookie) {
			$cookie = $this->cookie;
		}
		// 从上一次请求读取的cookie
		if ($this->host && isset(self::$cookies[ $this->host ])) {
			$cookie = isset($cookie) ? array_merge(self::$cookies[ $this->host ], $cookie) : self::$cookies[ $this->host ];
		}
		// 设置cookie
		if (isset($cookie)) {
			$cookie = $this->ary_kv_concat($cookie);
			curl_setopt($this->curl, CURLOPT_COOKIE, $cookie);
		}
		//自动设置referer
		if ($this->referer) {
			curl_setopt($this->curl, CURLOPT_REFERER, $this->referer);
		}
		//清空PostData
		curl_setopt($this->curl, CURLOPT_POSTFIELDS, '');
		//设置请求方法
		if ($method == 'get') {
			curl_setopt($this->curl, CURLOPT_HTTPGET, 1);
			curl_setopt($this->curl, CURLOPT_POST, 0);
		} else {
			curl_setopt($this->curl, CURLOPT_HTTPGET, 0);
			curl_setopt($this->curl, CURLOPT_POST, 1);
			//提交字段
			if ($postFields) {
				curl_setopt($this->curl, CURLOPT_POSTFIELDS, $postFields);
			}
		}
		curl_setopt($this->curl, CURLOPT_URL, $this->buildURL($url));
		$this->referer = $url;
		$this->ready   = true;
		$this->url     = $url;

		return $this;
	}
请求.

@param string $url        URL
@param string $method     请求方法.
@param array  $postFields POST字段.

@return \curlient\Curlient