0

Why does my POST request fail with a 503 error after exactly 30 seconds? Is this a browser or server issue?

This fails:

  fetch('http://www.mocky.io/v2/5e20fb8a300000b4a4d1f2af?mocky-delay=31000ms', {
    method: 'POST',
    body: JSON.stringify({ test: 1 })
  })

This works:

  fetch('http://www.mocky.io/v2/5e20fb8a300000b4a4d1f2af?mocky-delay=29000ms', {
    method: 'POST',
    body: JSON.stringify({ test: 1 })
  })

I've tried Chrome and Safari. Same result. I've tried Fetch and XMLHttpRequest. Same result. I've tried Mocky.io API and the API at my company.

MrGood
  • 545
  • 5
  • 21

1 Answers1

0

The reason why the 503 was being returned was the Load Balancer had a timeout of 30 seconds. So even if the API was returning a successful response after the 30 seconds, the load balancer returned a 503 before the API.

MrGood
  • 545
  • 5
  • 21