mirror of
https://github.com/jwilsson/spotify-web-api-php.git
synced 2026-04-27 07:55:49 +03:00
[GH-ISSUE #111] Urlencode user id's in POST/PUT requests #65
Labels
No labels
bug
docs
enhancement
enhancement
enhancement
feedback wanted
good first issue
help wanted
help wanted
help wanted
invalid
pull-request
question
question
upstream
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-web-api-php#65
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @PouleR on GitHub (Dec 20, 2017).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/111
When using a POST or PUT request to Spotify with a username like '#username' the request fails:
POST https://api.spotify.com/v1/users/#username/playlists` resulted in a `404 Not FoundWhen the user id is url encoded the request succeeds. It's difficult to test since you need to have access to an account that has this kind of username (in this case that starts with a '#').
A possible solution could be to always urlencode the userId in post/put requests, since I haven't noticed this behaviour with GET requests.
@jwilsson commented on GitHub (Dec 20, 2017):
Hi!
Thanks for the report.
It's pretty strange, though. I just created a test account with a "#" in the name, and I get a
404when I try to use a POST endpoint without URL encoding it. But when I try to URL encode it, I get a403response with the messageYou cannot create a playlist for another user.I'm gonna file an issue with Spotify and see what they say about it. If the solution is for us to URL encode it on our end, I'm totally fine with that.
@jwilsson commented on GitHub (Sep 22, 2018):
Hi again!
This seems to be fixed on Spotify's end, so I'm gonna close this.
Just give me a shout if further work is needed!