title: axios get request Error: Request failed with status code 504
body: <p>here is my code that makes an Http Get request to an API end point from one of the services running on Amazon Fargate service. The API is powered by Amazon API gateway and Lambda. Also this is a private api used with in the VPC and I also have setup the apigateway VPC end point to facilitate the same. I have received this error only once. All the subsequent calls made to the API were successful. </p>
  
  <p>My suspicion is that the lambda was not warm and that resulted a timeout. I am going to try setting a timeout for the axios code. any suggestions welcome</p>
  
  <pre><code>async getItems(): Promise &lt; any &gt; {
    try {
  
      let url = `https://vpce-[id].execute-api.ap-southeast-2.vpce.amazonaws.com/prod/items`
  
  
      const response = await axios.get(url, {
        headers: {
          'Authorization': `Bearer ${token}`,
          'x-apigw-api-id': `[api-id]`
        }
      });
  
      return response.data;
  
    } catch(error) {
      console.log(error);
      throw error;
    }
  }
  </code></pre>