src/Request/LushRequest.php
protected function initOptions()
    {
        // Set method
        if ($this->method == 'POST') {
            $this->addCurlOption(CURLOPT_POST, true);
        } elseif (in_array($this->method, ['DELETE', 'HEAD', 'PATCH', 'PUT'])) {
            if ($this->method == 'HEAD') {
                $this->addCurlOption(CURLOPT_NOBODY, true);
            }

            $this->addCurlOption(CURLOPT_CUSTOMREQUEST, $this->method);
        }

        // Set allowed protocols
        if (defined('CURLOPT_PROTOCOLS')) {
            $this->addCurlOption(CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
        }

        // Handle options from payload
        if (! empty($this->payload['options']) && is_array($this->payload['options'])) {
            // Add authentication
            $this->handleAuthentication();

            // Add user options
            $this->handleUserOptions();
        }

        $this->mergeCurlOptions();
    }
protected function initOptions()
    {
        // Set method
        if ($this->method == 'POST') {
            $this->addCurlOption(CURLOPT_POST, true);
        } elseif (in_array($this->method, ['DELETE', 'HEAD', 'PATCH', 'PUT'])) {
            if ($this->method == 'HEAD') {
                $this->addCurlOption(CURLOPT_NOBODY, true);
            }

            $this->addCurlOption(CURLOPT_CUSTOMREQUEST, $this->method);
        }

        // Set allowed protocols
        if (defined('CURLOPT_PROTOCOLS')) {
            $this->addCurlOption(CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
        }

        // Handle options from payload
        if (! empty($this->payload['options']) && is_array($this->payload['options'])) {
            // Add authentication
            $this->handleAuthentication();

            // Add user options
            $this->handleUserOptions();
        }

        $this->mergeCurlOptions();
    }
protected function initOptions ( ) { // Set method if ( $ this -> method == 'POST' ) { $ this -> addCurlOption ( CURLOPT_POST , true ) ; } elseif ( in_array ( $ this -> method , [ 'DELETE' , 'HEAD' , 'PATCH' , 'PUT' ] ) ) { if ( $ this -> method == 'HEAD' ) { $ this -> addCurlOption ( CURLOPT_NOBODY , true ) ; } $ this -> addCurlOption ( CURLOPT_CUSTOMREQUEST , $ this -> method ) ; } // Set allowed protocols if ( defined ( 'CURLOPT_PROTOCOLS' ) ) { $ this -> addCurlOption ( CURLOPT_PROTOCOLS , CURLPROTO_HTTP | CURLPROTO_HTTPS ) ; } // Handle options from payload if ( ! empty ( $ this -> payload [ 'options' ] ) && is_array ( $ this -> payload [ 'options' ] ) ) { // Add authentication $ this -> handleAuthentication ( ) ; // Add user options $ this -> handleUserOptions ( ) ; } $ this -> mergeCurlOptions ( ) ; }
Set request options.
Set request options .