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

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

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-

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 

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!

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

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

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.

 

Hi Roman & Murat, 

I'm trying the same for my use case, the page is not actually redirecting as expected, can you please attach a sample OML


With Regards,

Sandeep.

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

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


Champion

Here is how I solved it...

1. Creat a screen called "Bridge" (traditional module) with input parameters as expected in the POST request.
2. Save the input parameters in to an entity (public, read only)
3. Send the Entity Id from step 2 to the reactive screen that fetches the record from database and complete the work.

Now, instead of posting to react screen directly, POST to the Bridge screen created in step 1

Note: I do NOT recommend this technique for senstive information like credit cards without some planning and secuirty checks.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.