Javascript Fetch API with Promises – Passing HTTP response code I’m using the following code to make HTTP requests to my API: