Adds a property on BackendService for an array of PreparationStrategy. These are executed in order just before every request is sent, allowing for just-in-time modifications to the request before send. They execute async, and can throw. Errors thrown from a PreparationStrategy are not recoverable using the existingRecoveryStrategy machinery and throw to the caller immediately (they do not hit the server). This is useful for applying a dynamic property to every request that isn't as simple as setting a common header.
Whereas previously this signature would need to be applied to each request, the PreparationStrategy allows this logic to reside in one place, apply to all outgoing requests, but still be based on the properties of each individual request.
Adds a property on
BackendService
for an array ofPreparationStrategy
. These are executed in order just before every request is sent, allowing for just-in-time modifications to the request before send. They executeasync
, and canthrow
. Errors thrown from aPreparationStrategy
are not recoverable using the existingRecoveryStrategy
machinery and throw to the caller immediately (they do not hit the server). This is useful for applying a dynamic property to every request that isn't as simple as setting a common header.For example
Whereas previously this signature would need to be applied to each request, the
PreparationStrategy
allows this logic to reside in one place, apply to all outgoing requests, but still be based on the properties of each individual request.