I have been working with the Spotify API. I want to perform some actions on playlists, these require a user to login. I want to execute the following url so as I can get an authorization bearer:
When I execute this in a browser URL field, it works fine and will return an authorization token. I f i try to execute this from an index.php file however I run into problems.
<?php
$curl = curl_init();
curl_setopt($curl,CURLOPT_URL,$url);
$output = curl_exec($curl);
curl_close($curl);
?>
When i run the file, the spotify login page will appear. However, after I enter my login details and hit enter nothing happens.
The console in the browser reports the following error:
POST http://localhost:8888/api/login 404 (Not Found) TypeError: Cannot create property 'error' on string '
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /api/login was not found on this server.</p>
</body></html>
I have added a .htaccess to the folder as well as change the Directory AllowOverride to All in the httpd.conf file in my mamps server. There are multiple AllowOverrides and I am not 100% sure which one to change.
If it isn't obvious by now, I am copmletly lost when it comes to this so any help would be gratefully appreciated.