[GH-ISSUE #198] /player/next API Compatibility with librespot-java #129

Closed
opened 2026-02-28 14:25:38 +03:00 by kerem · 5 comments
Owner

Originally created by @iVolt1 on GitHub (Aug 21, 2025).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/198

Currently, the go-librespot /player/next endpoint requires a POST body (even an empty JSON object) where as the librespot-java /player/next endpoint does not require a POST body . This breaks go-librespot compatibility with Home Assistant’s media player, which sends the /player/next request without a body. Aligning the go-librespot behavior with librespot-java would improve integration and allow me to move forward cleanly with my new music addon for Home Assistant.

This issue was previously reported in https://github.com/devgianlu/go-librespot/issues/151 .

This is probably a one or two line code change, so if any of the developers here could create a pull request for this, it would be greatly appreciated.

Thanks for your excellent work on this project—go-librespot has been rock-solid in my setup and offers great performance and reliability.

IVolt1

Originally created by @iVolt1 on GitHub (Aug 21, 2025). Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/198 Currently, the go-librespot /player/next endpoint requires a POST body (even an empty JSON object) where as the librespot-java /player/next endpoint does not require a POST body . This breaks go-librespot compatibility with Home Assistant’s media player, which sends the /player/next request without a body. Aligning the go-librespot behavior with librespot-java would improve integration and allow me to move forward cleanly with my new music addon for Home Assistant. This issue was previously reported in https://github.com/devgianlu/go-librespot/issues/151 . This is probably a one or two line code change, so if any of the developers here could create a pull request for this, it would be greatly appreciated. Thanks for your excellent work on this project—go-librespot has been rock-solid in my setup and offers great performance and reliability. IVolt1
kerem closed this issue 2026-02-28 14:25:38 +03:00
Author
Owner

@devgianlu commented on GitHub (Aug 21, 2025):

I see why you would want this change, but having the request be a GET is a bad design choice and won't be implemented. I think the best course of action is to get the Home Assistant plugin updated.

<!-- gh-comment-id:3211490933 --> @devgianlu commented on GitHub (Aug 21, 2025): I see why you would want this change, but having the request be a GET is a bad design choice and won't be implemented. I think the best course of action is to get the Home Assistant plugin updated.
Author
Owner

@iVolt1 commented on GitHub (Aug 21, 2025):

My apologies if I was not clear, try as I may, so please allow to give it another try. Changing the POST to a GET is not what I am suggesting.

As you replied to stronk-dev in https://github.com/devgianlu/go-librespot/issues/151, "You should be able to make a POST request to /player/next with an empty JSON object as body. The uri field is not mandatory."

The problem is that a POST request to /player/next with a JSON object as body is mandatory in go-librespot, but a JSON object as body is optional in a POST request to /player/next in librespot-java. The API in Home Assistant does not include a JSON object for a POST request to /player/next so the POST call fails with go-librespot.

Allowing the go-librespot API to accept a POST request to /player/next without a JSON object as body is what I am requesting.

This is the only difference in API behavior I have seen between librespot-java and go-librespot. I tried looking through the code of both of those librespot versions to pinpoint what needs to be done, but it is beyond my capabilities at this time.

Thanks,

iVolt1

<!-- gh-comment-id:3212242394 --> @iVolt1 commented on GitHub (Aug 21, 2025): My apologies if I was not clear, try as I may, so please allow to give it another try. Changing the POST to a GET is not what I am suggesting. As you replied to [stronk-dev](https://github.com/stronk-dev) in https://github.com/devgianlu/go-librespot/issues/151, "You should be able to make a POST request to /player/next with an empty JSON object as body. The uri field is not mandatory." The problem is that a POST request to /player/next with a JSON object as body is mandatory in go-librespot, but a JSON object as body is optional in a POST request to /player/next in librespot-java. The API in Home Assistant does not include a JSON object for a POST request to /player/next so the POST call fails with go-librespot. Allowing the go-librespot API to accept a POST request to /player/next without a JSON object as body is what I am requesting. This is the only difference in API behavior I have seen between librespot-java and go-librespot. I tried looking through the code of both of those librespot versions to pinpoint what needs to be done, but it is beyond my capabilities at this time. Thanks, iVolt1
Author
Owner

@devgianlu commented on GitHub (Aug 30, 2025):

Ah I see what you mean now

<!-- gh-comment-id:3239307396 --> @devgianlu commented on GitHub (Aug 30, 2025): Ah I see what you mean now
Author
Owner

@devgianlu commented on GitHub (Aug 30, 2025):

Should be good now, you can make a request with an empty POST body.

<!-- gh-comment-id:3239310326 --> @devgianlu commented on GitHub (Aug 30, 2025): Should be good now, you can make a request with an empty POST body.
Author
Owner

@iVolt1 commented on GitHub (Aug 30, 2025):

Thank you for completing this! I was working on my first ever PR for this but it looks like you made some more comprehensive changes.

<!-- gh-comment-id:3239324229 --> @iVolt1 commented on GitHub (Aug 30, 2025): Thank you for completing this! I was working on my first ever PR for this but it looks like you made some more comprehensive changes.
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/go-librespot#129
No description provided.