#sugam1469_webhooks

1 messages ¡ Page 1 of 1 (latest)

midnight juniperBOT
uncut meteorBOT
#

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.

midnight juniperBOT
#

👋 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.

dim relic
#

Looks like your webhook endpoint doesn't support the POST method, you might want to check its configuration to allow it accept POST requests

north owl
#

The same endpoint is working fine in localhosy

#

localhost*

dim relic
#

That means the localhost endpoint supports POST method

north owl
#

Then how can I config the webhook of my live website to support the POST method

dim relic
#

You might want to check with your hosting provider/

north owl
#

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)

dim relic
#

So have you checked with your hosting provider?

north owl
#

Yes I have and it supports POST method

dim relic
#

Ok, what's your endpoint URL?

north owl
dim relic
#

< 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.

north owl
#

Is that the reason the stripe is not getting my acknowledgement?

dim relic
#

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.

north owl
#

Ok thank you I will work on it.