http-client icon indicating copy to clipboard operation
http-client copied to clipboard

Add inactivity timeout to SetRequestTimeout interceptor

Open Nek- opened this issue 1 year ago • 2 comments

I figured out that the inactivity timeout was not present in the default interceptor in charge of updating the timeouts.

Of course it's not a big deal and here is a workaround:

$this->httpClient = (new HttpClientBuilder)
    ->interceptNetwork(
        new ModifyRequest(static function (Request $request) {
            $request->setInactivityTimeout(500);

            return $request;
        })
    )
    ->build();

But I decided maybe it's a good first contribution here 😄 . I also updated a bit the documentation because it was missing in the interceptor list! However, I'm sorry I don't know how to fix the test.

Nek- avatar Apr 26 '24 23:04 Nek-

Thanks! It looks like the test you added is failing due to a mis-matched message. Could you take a look at that?

trowski avatar May 10 '24 22:05 trowski

Oops. Sorry, it was late! 😂

Fixed it! 🙏

Nek- avatar May 14 '24 12:05 Nek-

Thanks!

kelunik avatar Jun 02 '24 19:06 kelunik