src/Bridge.php
public function getRequestOptions($initial = [])
    {
        // Define options.
        $options = collect($initial);

        // Define an auth option.
        if ($this->authMethod == 'credentials') {
            $options = $options->merge(['auth' => $this->getAuth()]);
        } elseif ($this->authMethod == 'token') {
            $this->appendHeaders(['X-Watson-Authorization-Token' => $this->getToken()]);
        }

        // Put Headers in options.
        $options = $options->merge(['headers' => $this->getHeaders()]);

        // Clean and return.
        return $this->cleanOptions($options->all());
    }
public function getRequestOptions($initial = [])
    {
        // Define options.
        $options = collect($initial);

        // Define an auth option.
        if ($this->authMethod == 'credentials') {
            $options = $options->merge(['auth' => $this->getAuth()]);
        } elseif ($this->authMethod == 'token') {
            $this->appendHeaders(['X-Watson-Authorization-Token' => $this->getToken()]);
        }

        // Put Headers in options.
        $options = $options->merge(['headers' => $this->getHeaders()]);

        // Clean and return.
        return $this->cleanOptions($options->all());
    }
public function getRequestOptions ( $ initial = [ ] ) { // Define options. $ options = collect ( $ initial ) ; // Define an auth option. if ( $ this -> authMethod == 'credentials' ) { $ options = $ options -> merge ( [ 'auth' => $ this -> getAuth ( ) ] ) ; } elseif ( $ this -> authMethod == 'token' ) { $ this -> appendHeaders ( [ 'X-Watson-Authorization-Token' => $ this -> getToken ( ) ] ) ; } // Put Headers in options. $ options = $ options -> merge ( [ 'headers' => $ this -> getHeaders ( ) ] ) ; // Clean and return. return $ this -> cleanOptions ( $ options -> all ( ) ) ; }
Get Request options to pass along.

@param array $initial

@return array
Get Request options to pass along .