[GH-ISSUE #121] request.php broken on line 194 #73

Closed
opened 2026-02-27 19:25:54 +03:00 by kerem · 4 comments
Owner

Originally created by @outspokenmagazine on GitHub (Apr 24, 2018).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/121

original line 194
$url .= '/?' . $parameters;

was ending up every search request in a 404 response for me.
I removed the / to:
$url .= '?' . $parameters;

now all works

I did that by following the spotify web api reference call

Originally created by @outspokenmagazine on GitHub (Apr 24, 2018). Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/121 original line 194 $url .= '/?' . $parameters; was ending up every search request in a 404 response for me. I removed the / to: $url .= '?' . $parameters; now all works I did that by following the spotify web api reference call
kerem closed this issue 2026-02-27 19:25:55 +03:00
Author
Owner

@jwilsson commented on GitHub (Apr 24, 2018):

Hmm, strange.

When I try, everything works. I tried with cURL as well, both with and without a slash before the question mark.

Could you post the code you're using? And which version of this library are you using?

<!-- gh-comment-id:384041239 --> @jwilsson commented on GitHub (Apr 24, 2018): Hmm, strange. When I try, everything works. I tried with cURL as well, both with and without a slash before the question mark. Could you post the code you're using? And which version of this library are you using?
Author
Owner

@outspokenmagazine commented on GitHub (Apr 25, 2018):

Hey, you are right. I tested with straight curl and it does not make any difference there.
Thats strange indeed.

I downloaded your package via composer and I am currently using 2.2.0 (in regards to what the changelog says)

and here is what I am doing in my code in detail:

          $artistname = 'slayer';

          require 'vendor/autoload.php';
          $session = new SpotifyWebAPI\Session(
              'xxxxx',
              'xxxxx'
          );

          $session->requestCredentialsToken();
          $accessToken = $session->getAccessToken();
          $api = new SpotifyWebAPI\SpotifyWebAPI();
          $api->setAccessToken($accessToken);
          $results = $api->search($artistname, 'artist');

Maybe I just did a rookies mistake and misunderstand how to use it. The last line was ending up in the 404 response from spotify, which I then was able to track down what I wrote in the initial incident.

<!-- gh-comment-id:384170227 --> @outspokenmagazine commented on GitHub (Apr 25, 2018): Hey, you are right. I tested with straight curl and it does not make any difference there. Thats strange indeed. I downloaded your package via composer and I am currently using 2.2.0 (in regards to what the changelog says) and here is what I am doing in my code in detail: $artistname = 'slayer'; require 'vendor/autoload.php'; $session = new SpotifyWebAPI\Session( 'xxxxx', 'xxxxx' ); $session->requestCredentialsToken(); $accessToken = $session->getAccessToken(); $api = new SpotifyWebAPI\SpotifyWebAPI(); $api->setAccessToken($accessToken); $results = $api->search($artistname, 'artist'); Maybe I just did a rookies mistake and misunderstand how to use it. The last line was ending up in the 404 response from spotify, which I then was able to track down what I wrote in the initial incident.
Author
Owner

@jwilsson commented on GitHub (Apr 25, 2018):

I tested your code and that works just fine. I'm guessing you've tested again since yesterday? Cause it seems Spotify had some issues with the search endpoint.

<!-- gh-comment-id:384388095 --> @jwilsson commented on GitHub (Apr 25, 2018): I tested your code and that works just fine. I'm guessing you've tested again since yesterday? Cause it seems [Spotify had some issues](https://github.com/spotify/web-api/issues/847) with the search endpoint.
Author
Owner

@outspokenmagazine commented on GitHub (Apr 26, 2018):

I did just retest the old code, and indeed today it is not giving me any 404 responses. So you are right, it must have been an issue in regards to Spotify endpoints problems.

Thank you for looking into it anyway and of course many thanks for the package in general!

<!-- gh-comment-id:384528976 --> @outspokenmagazine commented on GitHub (Apr 26, 2018): I did just retest the old code, and indeed today it is not giving me any 404 responses. So you are right, it must have been an issue in regards to Spotify endpoints problems. Thank you for looking into it anyway and of course many thanks for the package in general!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-web-api-php#73
No description provided.