helpscout-api-php icon indicating copy to clipboard operation
helpscout-api-php copied to clipboard

Allow setting Guzzle options such as timeout

Open matt-allan opened this issue 4 years ago • 1 comments

  • PHP version: 8.0.6
  • SDK version: 3.3.2

Current behavior

It's not possible to set options for the Guzzle client used by the SDK.

Expected behavior

It would be really helpful if we could set options for the Guzzle client so we could set timeouts, logging, etc.

Steps to reproduce N/A

Hi, it would be really helpful if we could set options for the Guzzle client used by RestClient, Authenticator, etc. Right now the only way to do that is to overwrite 3 methods on the RestClientBuilder and copy a lot of code.

It would be great if we could add a constructor parameter or add a method that allows retrieving the underlying Guzzle client so we could update the options on it.

Our use case is setting Guzzle's timeout option. It defaults to 0, which means any issues with HelpScout will cause the script to hang for > 30 seconds. We would like to be able to set a reasonable timeout of ~10 seconds.

matt-allan avatar May 11 '21 16:05 matt-allan

Hey Matt,

This makes a lot of sense, I can see how currently this is more difficult than it needs to be. I'll make sure this is in our radar, but in the meantime, we'd welcome a PR for a cleaner approach to doing this.

A quick thought on this might be, perhaps RestClientBuilder::__construct(array $config) could accept Guzzle runtime parameters in a guzzle key to be passed to the client.

We'll update this thread when there's something in place to make this easier.

bkuhl avatar May 19 '21 20:05 bkuhl

We're closing this issue due to inactivity. We've moved your request to our backlog of tickets, although we can't tell when we will be able to act on it. Please feel free to reopen if needed. Thank you!

miguelrs avatar Jan 17 '24 09:01 miguelrs