I am new to Mojolicious and using plugins especially SecureCORS.
How can I allow CORS on POST requests?
I managed to allow CORS for GET with following lines:
use Mojolicious::Lite;
app->plugin('SecureCORS');
app->routes->to('cors.origin' => '*');
I thought 'cors.origin' => '*' is allowing CORS for all methods but it works only for GET.
Maybe there is another or better way to send the Access-Control-Allow-Origin header and allow all POST, GET, PUT, ...
Frankly said, I have not used SecureCors plugin but I faced the same problem of cross-origin problem while developing the REST API's in Mojolicious.
Note:- I am not using the Mojolicious::lite app.
You might need to do something more or less similar to this, under your startup subroutine (If not using Mojolicious::Lite).
I hope it helps.