src/Http.php
public function applyMethod() {
        if (!$this->verifySSL && $this->uri->isSSL()) {
            $this->setOption(CURLOPT_SSL_VERIFYPEER, FALSE)
                ->setOption(CURLOPT_SSL_VERIFYHOST, FALSE)
                ->setOption(CURLOPT_SSLVERSION, 1);
        }
        $this->setOption(CURLOPT_URL, (string)$this->getUrl());
        if ($this->method == self::GET) {
            return;
        }
        if ($this->method == self::HEAD) {
            $this->setOption(CURLOPT_CUSTOMREQUEST, strtoupper($this->method))
                ->setNoBody();
            return;
        }
        if (in_array($this->method,
            [self::OPTIONS, self::DELETE])) {
            $this->setOption(CURLOPT_CUSTOMREQUEST, strtoupper($this->method));
            return;
        }
        $parameters = $this->buildPostParameters();
        self::log('HTTP DATA: '.var_export($parameters, true));
        if ($this->method == self::POST) {
            $this->setOption(CURLOPT_POST, true)
                ->setOption(CURLOPT_POSTFIELDS, $parameters);
            return;
        }
        $this->setOption(CURLOPT_CUSTOMREQUEST, strtoupper($this->method))
            ->setOption(CURLOPT_POSTFIELDS, $parameters);
    }
public function applyMethod() {
        if (!$this->verifySSL && $this->uri->isSSL()) {
            $this->setOption(CURLOPT_SSL_VERIFYPEER, FALSE)
                ->setOption(CURLOPT_SSL_VERIFYHOST, FALSE)
                ->setOption(CURLOPT_SSLVERSION, 1);
        }
        $this->setOption(CURLOPT_URL, (string)$this->getUrl());
        if ($this->method == self::GET) {
            return;
        }
        if ($this->method == self::HEAD) {
            $this->setOption(CURLOPT_CUSTOMREQUEST, strtoupper($this->method))
                ->setNoBody();
            return;
        }
        if (in_array($this->method,
            [self::OPTIONS, self::DELETE])) {
            $this->setOption(CURLOPT_CUSTOMREQUEST, strtoupper($this->method));
            return;
        }
        $parameters = $this->buildPostParameters();
        self::log('HTTP DATA: '.var_export($parameters, true));
        if ($this->method == self::POST) {
            $this->setOption(CURLOPT_POST, true)
                ->setOption(CURLOPT_POSTFIELDS, $parameters);
            return;
        }
        $this->setOption(CURLOPT_CUSTOMREQUEST, strtoupper($this->method))
            ->setOption(CURLOPT_POSTFIELDS, $parameters);
    }
应用请求方式
@throws Exception