diff --git a/b3-dev/api/api-php-call/CORS/index.php b/b3-dev/api/api-php-call/CORS/index.php new file mode 100644 index 0000000..cdfb68a --- /dev/null +++ b/b3-dev/api/api-php-call/CORS/index.php @@ -0,0 +1,52 @@ + + + +
+ +++ + + + + \ No newline at end of file diff --git a/b3-dev/api/api-php-call/calls/index.php b/b3-dev/api/api-php-call/calls/index.php new file mode 100644 index 0000000..fe48c47 --- /dev/null +++ b/b3-dev/api/api-php-call/calls/index.php @@ -0,0 +1,50 @@ +features[0]->geometry->coordinates); + curl_close($curl); + + + $curl = curl_init(); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + + // curl_setopt($curl, CURLOPT_POST, 1); + // curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT"); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST"); + + $data['grant_type'] = 'client_credentials'; + curl_setopt($curl, CURLOPT_POSTFIELDS, $data); + + curl_setopt($curl, CURLOPT_URL, 'https://accounts.spotify.com/api/token'); + + $headers = array( + 'Authorization' => `Basic 1111111111111111111111111111111111`, + 'Content-Type' => 'application/x-www-form-urlencoded' + ); + + curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); + + $response_json = curl_exec($curl); + print_r($response_json); + //$response_php = json_decode($response_json); + //print_r($response_php->features[0]->geometry->coordinates); + curl_close($curl); \ No newline at end of file+ Header set Content-Security-Policy \ + " \ + script-src 'unsafe-eval' 'unsafe-inline' 'self' ssl.google-analytics.com www.google-analytics.com ajax.googleapis.com www.googletagmanager.com tarteaucitron.io www.tarteaucitron.io; \ + default-src 'none'; \ + connect-src 'self'; \ + img-src 'self' 'unsafe-inline' data: ssl.google-analytics.com www.google-analytics.com ajax.googleapis.com www.googletagmanager.com tarteaucitron.io www.tarteaucitron.io; \ + style-src 'self' 'unsafe-inline' ssl.google-analytics.com tarteaucitron.io www.tarteaucitron.io; \ + base-uri 'self'; \ + font-src 'self' data:; \ + " + + + +