title: Can not call external api in aws lambda function
body: <p>I was going to call third party api in the aws lambda function with request. But it shows timeout error.
  I set the lambda function time 30s and when I call that api by using postman it send response(error) with in 5 seconds.
  I think the request or axios can't send the request to the external api or can't receive the response.
  Can anyone help me?
  My code:</p>
  <pre><code>  request.post({url:url2, json:true, body:body, headers: {
      'ACCESS_TIMESTAMP': timestamp,
      'Content-Type': 'application/json'
    } }, (error, response, body) =&gt; {
    console.log(&quot;------------------I am here----------------------&quot;)
    callback(null, error)
  })
  </code></pre>
  <p>When I use the axios the code is like below:</p>
  <pre><code>let jsonbody = JSON.stringify(body)
  axios.post(url2, jsonbody,  {headers: {
        'ACCESS_TIMESTAMP': timestamp,
        'Content-Type': 'application/json'
      }})
  .then(res =&gt; {
    callback(null, res.data)
  })
  .catch(err =&gt; {
    callback(null, err)
  })
  </code></pre>
  <p>I want to get the result of res or err but they don't act.</p>