255
Views
10
Comments
Error 405 when submitting a Post - Reactive Application
Question

Hello.


I am getting an error when i send an html form created by a Checkout.JS wich tokenizes a credit/debit card information, and sends it through a Html form, with a Post method to a webscreen, this webscreen has to get the form value.

When I tried it, it gave me an error:

“405 - HTTP verb used to access this page is not allowed.

The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.”


Thank you.

mvp_badge
MVP
Rank: #17

Hi Ammet,

So basically the error message tells you, that you cannot use the POST method.

Could you give more context or maybe share (part) of the OutSystems code?

Regards,

Daniel

Daniël Kuhlmann wrote:

Hi Ammet,

So basically the error message tells you, that you cannot use the POST method.

Could you give more context or maybe share (part) of the OutSystems code?

Regards,

Daniel

Hi Daniël,

I have 3 buttons.

'Token' Button, calls a REST API, it returns a Token

'Session' Button' uses this Token and the Amount value in the input, to create a Token Session.

...


'Pago' Button contains a javascript. (This)

 It creates a form inside a hidden container under the buttons.



So, when i click 'Pago' button, the js creates 'Paga Aqui' blue button. This blue button opens a form who permforms the Post Method.



But i got this error



Now, all this is done in Reactive. If i change the 'action' attribute to a WebsCreen from another module (Traditional Web), i can successfully get the response of that form, with a GetRequestContent in the preparation of the Webscreen (Traditional Web)



Kind regards.

Ammet.



mvp_badge
MVP
Rank: #50

Hi Ammet ,

I found few posts on google and most of the people solved it with this. Please check below link if you can get any help.

https://forums.iis.net/t/1201030.aspx?405+HTTP+verb+used+to+access+this+page+is+not+allowed+


Regards,

-PJ-

Staff
Rank: #20

Hi Ammet,

Another option you may want to explore is to create a rest service that supports post that then redirects to a reactive screen. 

Cheers,

Tiago Simões 

Rank: #3071

Tiago Simões wrote:

Hi Ammet,

Another option you may want to explore is to create a rest service that supports post that then redirects to a reactive screen. 

Cheers,

Tiago Simões 

Hi Tiago,

pls can you help me how can I redirect from REST API Method to react (or any other) screen?

I am facing similar problem in mobile app (and the same in react). After user authorization on Microsoft login page it redirects me back with needed "code" value in POST Form Data request. If I set redirect uri to react or traditional screen, I am not able read the value from "Form Data". If I set redirect uri to REST endpoint I can read this value, but my app stops on empty screen and I am not able return user to home screen.

I am following this guide:
https://winsmarts.com/how-to-call-the-userinfo-endpoint-in-azuread-6ff769567a5a

Thanks for any help!

Staff
Rank: #20

Hi Roman,

You can use the HTTPRequestHandler extension. You may need also to change the Rest API Method HTTP Method property to POST.


Cheers,
Tiago Simões

Rank: #3071

Thank you very much, that's exactly what I needed

Rank: #84625

Roman Scheinherr wrote:

Thank you very much, that's exactly what I needed

 Hi Roman, i am exactly trying to do the same process now, could you explain how you solve the problem? Thank you.

 

Rank: #3071

Hi Murat, it is exactly what has Tiago shown on the previous post. You have to change the StatusCode to 302 to perform URL redirection and add new header parameter "Location" with the text value of URL you want to redirect after procesing this POST.

Hope it helps
Roman

mvp_badge
MVP
Rank: #160

Complementing this post

"Everything depends on the modules installed in your IIS, if you have configured so that your IIS has WebDAVModule enabled, it will limit your requests in GET and POST. To disable this module and release all verbs, just update your web.config as mine below

<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule"/>
</modules>
"

In this case the villain was the WebDav

Source: https://programadriano.medium.com/iis-erro-405-method-not-allowed-8fe7176f168