sdk-client-v2: ex createHttpMiddleware(options) now createHttpClient(options): no retryOnAbort?

179 Views Asked by At

in the documentation of sdk-middleware-http about createHttpMiddleware(options) I see

12. retryOnAbort (Boolean): Configure the client to retry an aborted request or not. Defaults to false.

But looks like this is not exists anymore in @commercetools/sdk-client-v2/createHttpClient?

2

There are 2 best solutions below

0
Brian Tomkins On BEST ANSWER
1
Stephen On

If you're using the TypeScript SDK (the "v2 SDK") then use the HttpMiddlewareOptions middleware and include it with your Client:

TypeScriptSDKclient

You can find out more about what middleware is available for the TypeScript SDK at https://docs.commercetools.com/sdk/javascript-sdk#middleware . There is also a getting started guide to follow.