HTTP request to Teams webhook from a website is blocked by CORS
Givan, Claudia
0
Reputation points
Hello Microsoft Teams Support,
I have developed a website using Hugo and am attempting to send messages to a Microsoft Teams channel via a webhook. However, I'm encountering a CORS (Cross-Origin Resource Sharing) issue that is blocking the HTTP request.
Here is the code snippet I'm using:
const resp = await fetch(teamsWebhookURL, {
method: "POST",
body: JSON.stringify({ text: message }),
headers: {
"Content-Type": "application/json",
},
});
Could you please provide guidance on how to configure CORS to allow these requests, or is there a way to bypass the CORS policy in this context?
Thank you for your assistance.
Microsoft Teams | Development
4,115 questions
Sign in to answer