0

I am getting this error when my payment gateway is redirecting user to my react application. Same code works on firebase hosting and doesn't give the error. Redirection url is a POST request

I tried various solutions from Asp.NET Web API - 405 - HTTP verb used to access this page is not allowed - how to set handler mappings

removed WebDav

jps
  • 20,041
  • 15
  • 75
  • 79
Kiran Mohare
  • 11
  • 1
  • 6

2 Answers2

3

Assuming there is no CORS issue here.

The issue is the call back to your site is a Post request along with data. Client application's index.html hosted inside IIS is not able to understand how to handle a post request to a html page. You will have to specifically make an entry in Handler Mapping section of IIS configurations.

enter image description here

Inside Request Restrictions add the HTTP Methods you want it for or allow all verbs if it is a specific case.

enter image description here

Or you can directly put it in your web.config with what all verbs you want to allow, as in below snippet

    <add name="html" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="%windir%\system32\inetsrv\asp.dll" resourceType="Unspecified" requireAccess="None" /> 
Manish
  • 168
  • 3
0

On the Request Filtering page, switch to the "HTTP Verbs" tab - if you see that "POST" has "Allowed" set to False, this is the cause. Remove this entry or changing it to explicitly be allowed will fix the issue.

samwu
  • 3,857
  • 3
  • 11
  • 25