public function request(Config $config, ContentItems $contentItems)
    {
        $this->config = $config;

        $options = [
            'headers' => [
                'X-Watson-Authorization-Token' => $this->getAuthToken(),
                'X-Watson-Learning-Opt-Out' => $this->config->optOutOfLogging,
                'Content-Type' => 'application/json',
                'Accept' => 'application/json',
                'Accept-Language' => 'en'
            ],
            'body' => $contentItems->getContentItemsContainerJson()
        ];

        $response = $this->client->request(
            'POST',
            $config->getApiUrl(),
            $options
        );
        return json_decode($response->getBody());
    }
public function request(Config $config, ContentItems $contentItems)
    {
        $this->config = $config;

        $options = [
            'headers' => [
                'X-Watson-Authorization-Token' => $this->getAuthToken(),
                'X-Watson-Learning-Opt-Out' => $this->config->optOutOfLogging,
                'Content-Type' => 'application/json',
                'Accept' => 'application/json',
                'Accept-Language' => 'en'
            ],
            'body' => $contentItems->getContentItemsContainerJson()
        ];

        $response = $this->client->request(
            'POST',
            $config->getApiUrl(),
            $options
        );
        return json_decode($response->getBody());
    }
public function request ( Config $ config , ContentItems $ contentItems ) { $ this -> config = $ config ; $ options = [ 'headers' => [ 'X-Watson-Authorization-Token' => $ this -> getAuthToken ( ) , 'X-Watson-Learning-Opt-Out' => $ this -> config -> optOutOfLogging , 'Content-Type' => 'application/json' , 'Accept' => 'application/json' , 'Accept-Language' => 'en' ] , 'body' => $ contentItems -> getContentItemsContainerJson ( ) ] ; $ response = $ this -> client -> request ( 'POST' , $ config -> getApiUrl ( ) , $ options ) ; return json_decode ( $ response -> getBody ( ) ) ; }
Makes a request to Personality Insights

@param \Config $config The client config
@param \ContentItems $contentItems The collection of content

@return object

@throws PersonalityInsightsApiException
Makes a request to Personality Insights