setMethod

@param   array|string $methods

@return  Route  Return self to support chaining.
188748
public function setAllowMethods($methods)
    {
        $methods = (array) $methods;

        $methods = array_map('strtoupper', $methods);

        $this->allowMethods = $methods;

        return $this;
    }
122548
protected function setMethod($method)
    {
        switch (strtoupper($method)) {
            case 'HEAD':
                curl_setopt($this->request, CURLOPT_NOBODY, true);
                break;
            case 'GET':
                curl_setopt($this->request, CURLOPT_HTTPGET, true);
                break;
            case 'POST':
                curl_setopt($this->request, CURLOPT_POST, true);
                break;
            default:
                curl_setopt($this->request, CURLOPT_CUSTOMREQUEST, $method);
        }
    }
967637
public function setMethod($method) {
        if ($this->configured) throw new IllegalStateException('Configuration is frozen');
        $name = $this->name ? ' name="'.$this->name.'"':'';
        $path = $this->path ? ' path="'.$this->path.'"':'';

        $method = strtoupper($method);
        if ($method!='GET' && $method!='POST') throw new StrutsConfigException('<mapping'.$name.''.$path.' methods="'.func_get_arg(0).'":  Invalid HTTP method.');

        $this->methods[$method] = true;
        return $this;
    }
423438
public function setRoutes(array $routes)
    {
        $toIterate = RouteConfig::defaultRouteTypes();
        foreach ($routes as $key => $val) {
            if (in_array($key, $toIterate) && isset($this->routes[$key])) {
                $this->routes[$key] = array_merge($this->routes[$key], $val);
            } else {
                $this->routes[$key] = $val;
            }
        }

        return $this;
    }
1284225
public function methods(array $fieldsMethods)
    {
        foreach ($fieldsMethods as $field => $path) {
            $this->method($field, $path);
        }

        return $this;
    }
696772
public void setMethods(Set<String> methods) {
        this.methods = new HashSet<>();
        for (String method : methods) {
            this.methods.add(method.toUpperCase());
        }
    }
505321
public function setMethod($method)
    {
        parent::setMethod($method);
        if ($method !== 'GET') {
            switch ($method) {
                case 'POST':
                    $this->setOption(CURLOPT_POST, true);
                    break;
                default:
                    $this->setOption(CURLOPT_CUSTOMREQUEST, $this->method);
                    break;
            }
        }

        return $this;
    }
399431
public function setAccessControlAllowMethods($methods)
    {
        if (is_array($methods)) {
            $methods = implode(', ', $methods);
        }

        $this->setHeader('Access-Control-Allow-Methods', (string) $methods);

        return $this;
    }
402327
public function setMethod($method)
	{
		parent::setMethod($method);
		$method = strtolower($method);
		if($method == "aes-256-ecb")
		{
			$this->_type = MCRYPT_RIJNDAEL_128;
			$this->_mode = "ecb";
		}
		elseif($method == "aes-256-cbc")
		{
			$this->_type = MCRYPT_RIJNDAEL_128;
			$this->_mode = "cbc";
		}
	}
766758
public function setMethods(array $methods)
    {
        $methods = array_map('strtoupper', $methods);
        $diff = array_diff($methods, static::VALID_METHODS);
        if ($diff !== []) {
            throw new InvalidArgumentException(
                sprintf('Invalid HTTP method received. %s is invalid.', implode(', ', $diff))
            );
        }
        $this->defaults['_method'] = $methods;

        return $this;
    }
383407
public function addAllowedMethods(array $methods): MethodNotAllowed
    {
        $this->allowedMethods = array_merge($this->allowedMethods, $methods);

        return $this;
    }
435100
public function setMethod($method) {
        $methods = array(
            COMPLETION_AGGREGATION_ALL,
            COMPLETION_AGGREGATION_ANY,
        );

        if (in_array($method, $methods)) {
            $this->method = $method;
        } else {
            $this->method = COMPLETION_AGGREGATION_ALL;
        }
    }
276672
public function setMethods($methods)
    {
        if (is_string($methods)) {
            if (!isset(self::$validMethods[strtolower($methods)])) {
                throw new \LogicException(sprintf('Route method "%s" is invalid. Params expected "%s"', $methods, implode(', ', array_keys(self::$validMethods))));
            }
            $this->methods = array($methods);
        }
        
        if (is_array($methods)) {
            $this->methods = $methods;
        }
        
        return $this;
    }
1034404
public function setMethods(array $methods) {
        foreach ($methods as $method) {
            if ( ! HttpRequestMethod::isValid($method)) {
                throw new Exception(
                    s(
                        'Invalid request method %s. Valid methods are %s.',
                        $method, implode(', ', HttpRequestMethod::getMethods())
                    )
                );
            }
        }

        $this->methods = $methods;
    }
1150016
public function setMethod($method = '')
    {
        if (mb_strlen($method) == 0) {
            $this->debug->debug(__FUNCTION__, 'Set Default Method = GET if $method is does not exist');
            $method = 'GET';
        } else {
            $method       = strtoupper($method);
            $validMethods = [
                'GET',
                'HEAD',
                'PUT',
                'POST',
                'DELETE'
            ];
            if (!in_array($method, $validMethods)) {
                $message = "Error: " . __CLASS__ . ": The requested method (${method}) is not valid here";
                $this->debug->error(__FUNCTION__, $message);

                return $message;
            }
        }
        $this->method = $method;

        return $this;
    }
730355
public function setMethod($method)
    {
        $method = strtolower($method);

        if (in_array($method, [Form::METHOD_GET, Form::METHOD_POST])) {
            $this->method = $method;
        } else {
            throw new \Exception('Incorrect method value given');
        }
        return $this;
    }
345883
public function setMethod( $method, $resetStatus = TRUE ){
		$this->validateMethod( $method );
		if( $this->method !== $method ){
			$this->method	= $method;
			if( $resetStatus )
				$this->status	= self::STATUS_UNKNOWN;
		}
		return $this;
	}