[GH-ISSUE #159] custom curl options by user #102

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

Originally created by @csimpi on GitHub (Jun 21, 2019).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/159

Hi,
thx for your awesome work!

I'd like to set some curl options. I can't change Request.php in the vendor folder for obvious reason.
Is it possible to set/overwrite the $options array from my code? If it's not it would be an awesome (and must-have) feature.

Currently, I'm getting timeout error messages randomly when I'm connecting to api.spotify.com, I'd need to set the curl connection timeout option and fine-tune the request-response frequency.

Originally created by @csimpi on GitHub (Jun 21, 2019). Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/159 Hi, thx for your awesome work! I'd like to set some curl options. I can't change `Request.php` in the `vendor` folder for obvious reason. Is it possible to set/overwrite the `$options` array from my code? If it's not it would be an awesome (and must-have) feature. Currently, I'm getting timeout error messages randomly when I'm connecting to api.spotify.com, I'd need to set the curl connection timeout option and fine-tune the request-response frequency.
kerem 2026-02-27 19:26:05 +03:00
Author
Owner

@csimpi commented on GitHub (Jun 22, 2019):

A quick workaround, using Guzzle instead of curl with this adapter:
https://github.com/andig/spotify-web-api-extensions

<!-- gh-comment-id:504626779 --> @csimpi commented on GitHub (Jun 22, 2019): A quick workaround, using Guzzle instead of curl with this adapter: https://github.com/andig/spotify-web-api-extensions
Author
Owner

@jwilsson commented on GitHub (Jun 26, 2019):

Hey!
Sorry for the late answer!

Sounds like a valid use case, I'll take a look at it over the weekend.

<!-- gh-comment-id:506003673 --> @jwilsson commented on GitHub (Jun 26, 2019): Hey! Sorry for the late answer! Sounds like a valid use case, I'll take a look at it over the weekend.
Author
Owner

@csimpi commented on GitHub (Jun 26, 2019):

@jwilsson
Thank you!
I think the best way would be making an adapter for the curl part with an opportunity to use any kind of external HTTP Clients.

Also, I'd recommend using Guzzle instead of curl. Curl has a lot of problems on several servers, lots of memory leaking problems, etc. Now that I have overridden the Request class and using Guzzle HTTP every other random issue has been disappeared (even behind a proxy).

<!-- gh-comment-id:506035247 --> @csimpi commented on GitHub (Jun 26, 2019): @jwilsson Thank you! I think the best way would be making an adapter for the curl part with an opportunity to use any kind of external HTTP Clients. Also, I'd recommend using Guzzle instead of curl. Curl has a lot of problems on several servers, lots of memory leaking problems, etc. Now that I have overridden the Request class and using Guzzle HTTP every other random issue has been disappeared (even behind a proxy).
Author
Owner

@jwilsson commented on GitHub (Jun 27, 2019):

@csimpi Absolutely, I agree! It's definitely something I've thought about and will look into for the next major release.

<!-- gh-comment-id:506201544 --> @jwilsson commented on GitHub (Jun 27, 2019): @csimpi Absolutely, I agree! It's definitely something I've thought about and will look into for the next major release.
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#102
No description provided.