Skip to content

Instantly share code, notes, and snippets.

@mobsense
Created September 8, 2020 03:15
Show Gist options
  • Save mobsense/d5c54708116e8095209c3767b2304875 to your computer and use it in GitHub Desktop.
Save mobsense/d5c54708116e8095209c3767b2304875 to your computer and use it in GitHub Desktop.
Sending a HTTP request without waiting for a response in Lambda
const https = require('https')
const URL = require('url')
async function request(url, data) {
return new Promise((resolve, reject) => {
let req = https.request(URL.parse(url))
req.write(data)
req.end(null, null, () => {
/* Request has been fully sent */
resolve(req)
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment