#sugam1469_webhooks
1 messages ¡ Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- sugam1469_webhooks, 6 days ago, 9 messages
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1245580639844044840
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Looks like your webhook endpoint doesn't support the POST method, you might want to check its configuration to allow it accept POST requests
That means the localhost endpoint supports POST method
Then how can I config the webhook of my live website to support the POST method
You might want to check with your hosting provider/
It was working fine a week ago
But the webhook didn't receive any acknowledgement and I modified my code and from then its stoped working
router.post("/webhook/endpoint", async (req: Request, res: Response) => {
try {
const webhookEvent = await handleWebhookEvent(req, res);
// return res.status(200);
return res.send();
} catch (error: any) {
// console.log(error);
return res.status(400).json({
errors: ${error.message},
});
}
});
I didn't do many changes simply i return res.send() in place of res.satus(200)
So have you checked with your hosting provider?
Yes I have and it supports POST method
Ok, what's your endpoint URL?
Web site created using create-react-app
< HTTP/2 405
< content-type: text/html; charset=utf-8
< content-length: 434
< allow: GET, HEAD, OPTIONS
< date: Thu, 30 May 2024 03:43:27 GMT
< server: AmazonS3
< x-cache: Error from cloudfront
< via: 1.1 a370c7b5bdcf78cf923b0b6c421f9688.cloudfront.net (CloudFront)
< x-amz-cf-pop: DFW56-P6
< x-amz-cf-id: _5z0hGj0Q2vI5xqjkSc2uR6gSVMKd3fSbVOKyz3xLMzz1HZKy91N_w==```
This is the response from sending a POST request
You can see that it only allows GET, HEAD, OPTIONS methods, not POST.
Is that the reason the stripe is not getting my acknowledgement?
Yes, and that's because your server doesn't allow POST method
I'd suggest you working with your host provider to ensure your webhook endpont accepts POST request.
Ok thank you I will work on it.