public function method($method)
    {
        $method  = strtolower($method);
        $builder = new RequestBuilder([
            'domain' => $this->domain,
            'basePath' => $this->basePath,
            'method' => $method,
            'guzzleOptions' => $this->guzzleOptions,
            'returnType' => $this->returnType,
        ]);
        $builder->withHeaders($this->headers);

        if (in_array($method, [ 'patch', 'post', 'put' ])) {
            $builder->withHeader(new ContentType('application/json'));
        }

        return $builder;
    }
public function method($method)
    {
        $method  = strtolower($method);
        $builder = new RequestBuilder([
            'domain' => $this->domain,
            'basePath' => $this->basePath,
            'method' => $method,
            'guzzleOptions' => $this->guzzleOptions,
            'returnType' => $this->returnType,
        ]);
        $builder->withHeaders($this->headers);

        if (in_array($method, [ 'patch', 'post', 'put' ])) {
            $builder->withHeader(new ContentType('application/json'));
        }

        return $builder;
    }
public function method ( $ method ) { $ method = strtolower ( $ method ) ; $ builder = new RequestBuilder ( [ 'domain' => $ this -> domain , 'basePath' => $ this -> basePath , 'method' => $ method , 'guzzleOptions' => $ this -> guzzleOptions , 'returnType' => $ this -> returnType , ] ) ; $ builder -> withHeaders ( $ this -> headers ) ; if ( in_array ( $ method , [ 'patch' , 'post' , 'put' ] ) ) { $ builder -> withHeader ( new ContentType ( 'application/json' ) ) ; } return $ builder ; }
Create a new RequestBuilder.
Similar to the above but does not use a magic method.

@param string $method - HTTP method to use (GET, POST, PATCH, etc).

@return RequestBuilder
Create a new RequestBuilder . Similar to the above but does not use a magic method .