Setting Up HTTP Request Retries Based on Status Code with Http.client
I am trying to understand how I can retry an HTTP request (with
Http.client.Client) based on the status code. I am currently using Http.client.filterStatusOk and Http.client.mapRequest to set up a client which is used in several places, but I have learnt that under certain conditions it can return a non-200 status code which means "not ready" and I'd like to retry in that case. Can I get a pointer on how to set this up? I have a long-form way of doing it.... which would involve using filterOrFail, checking for the status code and allowing it through, picking it up later in the pipe.... but wondering if there's a better, way?