Skip to content

Instantly share code, notes, and snippets.

View JiminyKroket's full-sized avatar

JiminyKroket

View GitHub Profile
@dragonwocky
dragonwocky / discord-webhook.js
Last active November 15, 2024 08:02
js post request example for discord webhooks using the fetch web api
// node.js versions pre-v0.18.0 do not support the fetch api and require a polyfill
// const fetch = require('node-fetch');
fetch(
'https://discordapp.com/api/webhooks/738983040323289120/mzhXrZz0hqOuUaPUjB_RBTE8XJUFLe8fe9mgeJjQCaxjHX14c3SW3ZR199_CDEI-xT56',
{
method: 'post',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({