For this issue, you need to add a '/' at the end of the url If you hit the url without the '/' on a browser, it will get a 302 and the browser will simply redirect. But the webhook does not follow redirects, so it simply tells you what the response was, which was a 302 redirect.
so to resolve this you need to use a '/' at the end of your url.
example:
<url>/git-webhook is you present url then you need to run it as <url>/git-webhook/
This will resolve your issue.