src/LinkedIn.php
protected function filterRequestOption(array &$options)
    {
        if (isset($options['json'])) {
            $options['format'] = 'json';
            $options['body'] = json_encode($options['json']);
        } elseif (!isset($options['format'])) {
            // Make sure we always have a format
            $options['format'] = $this->getFormat();
        }

        // Set correct headers for this format
        switch ($options['format']) {
            case 'xml':
                $options['headers']['Content-Type'] = 'text/xml';
                break;
            case 'json':
                $options['headers']['Content-Type'] = 'application/json';
                $options['headers']['x-li-format'] = 'json';
                $options['query']['format'] = 'json';
                break;
            default:
                // Do nothing
        }

        return $options['format'];
    }
protected function filterRequestOption(array &$options)
    {
        if (isset($options['json'])) {
            $options['format'] = 'json';
            $options['body'] = json_encode($options['json']);
        } elseif (!isset($options['format'])) {
            // Make sure we always have a format
            $options['format'] = $this->getFormat();
        }

        // Set correct headers for this format
        switch ($options['format']) {
            case 'xml':
                $options['headers']['Content-Type'] = 'text/xml';
                break;
            case 'json':
                $options['headers']['Content-Type'] = 'application/json';
                $options['headers']['x-li-format'] = 'json';
                $options['query']['format'] = 'json';
                break;
            default:
                // Do nothing
        }

        return $options['format'];
    }
protected function filterRequestOption ( array & $ options ) { if ( isset ( $ options [ 'json' ] ) ) { $ options [ 'format' ] = 'json' ; $ options [ 'body' ] = json_encode ( $ options [ 'json' ] ) ; } elseif ( ! isset ( $ options [ 'format' ] ) ) { // Make sure we always have a format $ options [ 'format' ] = $ this -> getFormat ( ) ; } // Set correct headers for this format switch ( $ options [ 'format' ] ) { case 'xml' : $ options [ 'headers' ] [ 'Content-Type' ] = 'text/xml' ; break ; case 'json' : $ options [ 'headers' ] [ 'Content-Type' ] = 'application/json' ; $ options [ 'headers' ] [ 'x-li-format' ] = 'json' ; $ options [ 'query' ] [ 'format' ] = 'json' ; break ; default : // Do nothing } return $ options [ 'format' ] ; }
Modify and filter the request options. Make sure we use the correct query parameters and headers.

@param array &$options

@return string the request format to use
Modify and filter the request options . Make sure we use the correct query parameters and headers .