Set the form method: GET, POST, PUT, DELETE.

@param string $method
@param bool $strict If non-null, pass value to {@link setStrictFormMethodCheck()}.
@return $this
430931
public function setFormMethod($method, $strict = null)
    {
        $this->formMethod = strtoupper($method);
        if ($strict !== null) {
            $this->setStrictFormMethodCheck($strict);
        }
        return $this;
    }
583434
public function setMethod($method)
    {
        $method = strtoupper($method);
        if (!defined('static::METHOD_' . $method) && !$this->getAllowCustomMethods()) {
            throw new \InvalidArgumentException('Invalid HTTP method passed');
        }
        $this->method = $method;
        return $this;
    }
558759
public function setMethod($method) {
        $this->method = (true === in_array($method, [self::HTTP_METHOD_GET, self::HTTP_METHOD_POST]) ? $method : self::HTTP_METHOD_POST);
        return $this;
    }
1352942
public function setTransport($method=null){
        switch($method){
            case "stream":
                $this->defaultOptions= array_merge_recursive($this->defaultOptions,[
                    'stream'        => true,
                    'stream_context' => [
                        'ssl' => [
                            'verify_peer' => false,
                            'verify_peer_name' => false,
                            'allow_self_signed' => true
                        ]
                    ]
                ]);
                break;
            case "curl":
            default:
                $method = 'curl';
                break;
        }
        $this->transportMethod = $method;
        return $this->initClient(); 
    }
266237
public function setParameter($key, $value, $strict = true)
    {
        $allowedParameters = $this->getAllowedParameters();
        if (!in_array($key, $allowedParameters)) {
            if ($strict) {
                throw new InvalidArgumentException("Parameter $key not allowed in ".get_class($this).'.');
            }

            return $this;
        }

        $this->parameters[$key] = $value;

        return $this;
    }
1267289
public function constrain($query, $model, $strict = false)
    {
        if ($model === '*') {
            return $this->constrainByWildcard($query);
        }

        $model = is_string($model) ? new $model : $model;

        $this->constrainByModel($query, $model, $strict);
    }
852242
protected function setRequestMethod($method)
    {
        // Preventing request methods collision
        $this->removeOption(CURLOPT_NOBODY);
        $this->removeOption(CURLOPT_HTTPGET);
        $this->removeOption(CURLOPT_POST);
        $this->removeOption(CURLOPT_CUSTOMREQUEST);

        switch (strtoupper($method)) {
            case 'HEAD':
                $this->addOption(CURLOPT_NOBODY, true);
            break;

            case 'GET':
                $this->addOption(CURLOPT_HTTPGET, true);
            break;

            case 'POST':
                $this->addOption(CURLOPT_POST, true);
            break;

            case 'RAW_POST':
                $this->addOption(CURLOPT_CUSTOMREQUEST, 'POST');
            break;

            default:
                $this->addOption(CURLOPT_CUSTOMREQUEST, $method);
        }
    }
652182
public function method($method)
    {
        if (!$this->isString($method) && !$this->isStringObject($method)) {
            throw new EventManagerException(EventManagerException::MSG_INVALID_ARG, [
                    '$method',
                    'string|StringObject'
                ]
            );
        }
        $this->method = StdObjectWrapper::toString($method);

        return $this;
    }
542135
public function setMethods($methods)
    {
        $this->methods = array_map('strtoupper', (array) $methods);
        $this->compiled = null;

        return $this;
    }
1217976
public function method($method)
    {
        // Convert to an array if needed
        if (!is_array($method)) {
            $method = [$method];
        }

        $this->method = $method;
        return $this;
    }
912182
public function method($method = null)
    {
        if (func_num_args() === 0) {
            return $this->_method;
        }
        $this->_method = strtoupper($method);
        return $this;
    }
749366
public function withMethod($method)
    {
        $method = strtoupper($method);

        if (false === in_array($method, ['GET', 'HEAD', 'POST', 'PUT', 'OPTIONS', 'DELETE'])) {
            throw new \InvalidArgumentException(
                sprintf('Invalid HTTP method: %s', $method)
            );
        }

        return $this->_clone('method', $method);
    }
1195758
public function setMethod(int $method)
    {
        $this->method = $method;
        curl_setopt($this->connection, $method, true);

        return $this;
    }
492207
public function setTransactionMethod($method)
    {
        // check if is array
        if (!is_array($this->transactionMethods)) {
            $this->transactionMethods = [$method];

            return $this;
        }

        // check if method is already in array
        if (!in_array($method, $this->transactionMethods)) {
            $this->transactionMethods[] = $method;
        }

        return $this;
    }
660090
protected function setupMethod($method)
    {
        if ('POST' == $method) {
            \curl_setopt($this->ch, CURLOPT_POST, true);
        } elseif (\in_array($method, ['PUT', 'DELETE', 'OPTIONS'])) {
            \curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, $method);
        }
    }
870098
public function create($method, $params)
    {
        if (strtolower($method) == 'get') {
            $this->get = $params;
        } else {
            $this->post = $params;
        }
        return $this;
    }
779061
public function enableRemote($method = null)
    {
        $this->is_remote = true;
        $this->disableCallback();// disable callback, we cannot have both

        if (!is_null($method) && method_exists($this, 'addAttribute')) {
            $this->addAttribute('data-method', $method);
        }

        return $this;
    }