Using async-http-client with async/await API works 20% of the time, for the same URL. Most times however the call returns an html file containing a 503 service unavailable error, but status code is 200 OK. The same call works with URLSession, cURL and wget reliably.
I don’t even know where to start debugging a problem like this. I tried forcing HTTP/1.0, using the redirect url directly.
My guess is that maybe MSGraph doesn’t like something about my request, but then, why would the exact same call work sometimes? Plus, the only thing that the API wants is an authorization header
503 is "Service Unavailable". Are you getting Retry-After http header in the response? I don't know if those other API's handle retries automatically or not, might be the case that they do and with your MSGraph you need to do it manually.
I don’t get a retry-after header. And the status code is 200… so MSGraph seems to just think it’s sending me the right file. I thought I might have be banned by a firewall, since everything worked perfectly until a week ago. But then switching to URLSession and curl seems to fix the problem… so clearly my IP is not banned
There were also a few instances where I got the file I requested, but at the end of it the service unavailable message was appended. Thankfully a checksum of the expected file caught this