PHP curl does not encode as brotli

78 views Asked by At

Response:

�0D �/����|⎄-�v�s������Fx}v�5���I��N�$����j��u Ll�Y��Q�����ݢ��C��Z� `E�$h�SBA4�d��v�4P%��2`�o����Z�+57o�T��ދ����{xU������g?i��g-xbV�v���=����ߟ�Ã��-WiJܭ�X�-�� �';mV�MM��eb�n �kU8ʡ�o-�`&4������B2� c4g���T2��b��D��o$�R�n>��j���o� ���s�4#XS��Һ�e�\aI�X�����A�"XĖe(\� `E��_ǤN����KA4%DP�)gJ�� ��kD���G=�� i�ݹ$BH�P�������h��C( '�| \���Ћh�C�m0N��ZH0�q���M�f��oϻw�w��?:{���7OiO����x�`O%�@J��$���Tσ��*&v^���Ŭ�yc�?���{���m��������7��0��+}U�����E!Tg ND{��2iЏ�$�؅�**-�i82��Z

My Code :

$curl = curl_init();

        curl_setopt_array($curl, [
            CURLOPT_URL => "https://songstats.p.rapidapi.com/artists/info?spotify_artist_id=2h93pZq0e7k5yf4dywlkpM&songstats_artist_id=vxk62ige",
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 30,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_CUSTOMREQUEST => "GET",
            CURLOPT_HTTPHEADER => [
                "X-RapidAPI-Host: songstats.p.rapidapi.com",
                "X-RapidAPI-Key: MY_API_KEY"
            ],
        ]);

        $response = curl_exec($curl);
        $err = curl_error($curl);

        curl_close($curl);

        if ($err) {
            echo "cURL Error #:" . $err;
        } else {
            echo $response;
        }
        exit;

I tried parameters such as gzip in the accept_encoding section, but these did not work either, I am looking for a different solution.

0

There are 0 answers