Set the request HTTP method
@param string $method The request HTTP method
@return Ebanx\Http\AbstractClient A "Ebanx\Http\AbstractClient" subclass object
@throws InvalidArgumentException
167963
public function setMethod($method)
    {
        if(!in_array(strtoupper($method), $this->allowedMethods)) {
          throw new \InvalidArgumentException("The HTTP Client doesn't accept $method requests.");
        }

        $this->method = $method;
        return $this;
    }
535828
public static function setMethod($method = 'auto')
    {
        if (!\in_array($method, ['auto', 'curl', 'fopen'], true)) {
            $method = 'auto';
        }

        self::$method = $method;

        return new self();
    }
345670
public function set( $method )
	{
		$method		= strtoupper( $method );
		if( !in_array( $method, self::$methods ) )
			throw new BadMethodCallException( 'HTTP method "%s" is not supported' );
		$this->method	= $method;
		return $this;
	}
729089
public function setMethod($method)
    {
        if (in_array(strtolower($method), ['publish', 'patch', 'move', 'swap'])) {
            $this->headers['X-HTTP-Method-Override'] = $method;
            $this->method = 'POST';
        } else {
            $this->method = strtoupper($method);
        }
    }
650483
protected function filterMethod($method)
    {
        if ($method === null) {
            return $method;
        }

        if (!is_string($method)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Unsupported HTTP method; must be a string, received %s',
                    is_object($method) ? get_class($method) : gettype($method)
                )
            );
        }

        $method = strtoupper($method);

        if (!in_array($method, self::$validMethods)) {
            throw new \InvalidArgumentException(sprintf('Invalid HTTP method "%s" provided', $method));
        }

        return $method;
    }
598654
public function setMethod($method)
    {
        $method     = strtoupper($method);
        $reflection = new \ReflectionClass('\JonnyW\PhantomJs\Http\RequestInterface');

        if (!$reflection->hasConstant('METHOD_' . $method)) {
            throw new InvalidMethodException(sprintf('Invalid method provided: %s', $method));
        }

        $this->method = $method;

        return $this;
    }
230394
protected function setMethod($method)
    {
        if (! is_string($method)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid HTTP method provided. Must be a string; received "%s".',
                is_object($method) ? get_class($method) : gettype($method)
            ));
        }

        $restMethod = strtoupper($method);

        if (in_array($restMethod, $this->restMethods)) {
            $method = $restMethod;
        }
        $this->method = $method;

        return $this;
    }
982653
protected function setRequestMethod($method) {
    switch (strtoupper($method)) {
      case 'HEAD':
        curl_setopt($this->request, CURLOPT_NOBODY, true);
        break;
      case 'GET':
        # Hack to allow a request body to be set via CURLOPT_POSTFIELDS
        # for GET requests.
        curl_setopt($this->request, CURLOPT_CUSTOMREQUEST, 'GET');
        break;
      case 'POST':
        curl_setopt($this->request, CURLOPT_POST, true);
        break;
      default:
        curl_setopt($this->request, CURLOPT_CUSTOMREQUEST, $method);
    }
  }
190815
protected function setMethod($method) {
        switch ($method) {
            case self::HTTP_METHOD_DELETE:
            case self::HTTP_METHOD_GET:
            case self::HTTP_METHOD_HEAD:
            case self::HTTP_METHOD_OPTIONS:
            case self::HTTP_METHOD_PATCH:
            case self::HTTP_METHOD_POST:
            case self::HTTP_METHOD_PUT:
                $this->method = $method;
                break;
            default:
                throw new InvalidHTTPMethodException($method);
        }
        return $this;
    }
1286549
public function withMethod($method): RequestInterface
    {
        $method = $this->filterMethod($method);

        $clone = clone $this;
        $clone->originalMethod = $method;
        $clone->method = null;

        return $clone;
    }
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;
    }
1077360
public function setMethod($method)
    {
        $method = strtolower($method);
        if (!in_array($method, ['post', 'get'])) {
            throw new InvalidArgumentException(
                'Method must be "post" or "get"'
            );
        }
        $this->method = $method;

        return $this;
    }
893990
public function setMethod(string $method): RequestContext
    {
        $method = strtoupper($method);

        if (!in_array($method, self::$availableMethods)) {
            throw new RequestContextException('Supplied HTTP method is not supported');
        }

        $this->method = $method;

        return $this;
    }
740653
public function setSelectionMethod($method)
    {
        if (!defined('self::SELECT_'.strtoupper($method))) {
            throw new InvalidArgumentException(sprintf('Selection method "%s" is unknown.', $method));
        }

        $this->selectionMethod = strtolower($method);
    }
1211214
public function setMethod($method)
    {
        foreach ($this->routes as $route)
            $route->setMethod($method);
        return $this;
    }
448187
public final function withMethod($method): RequestInterface
   {
       if (!is_string($method)
        || !($toUpperMethod = strtoupper((string) $method))
        || $toUpperMethod !== $this->parseMethod($method)) {
           throw new InvalidArgumentException(
               "Can't get instance for method: " . $method . " not supported");
       }
       return $this->with("method", $toUpperMethod);
   }
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(); 
    }