Here we go, I have a Mojolicious application that works when running on the morbo server. When I run it in IIS it seems to work, but when you submit any form, it's like IIS isn't sure which route is the GET or POST method.
so currently I have routes looking like
my $authorized = $r->under('/conditions_form')->to('Account#is_logged_in');
$authorized->get('/')->name('beach_conditions_form')->to('form#show_beach_conditions_form');
$authorized->post('/')->name('submit_conditions')->to('form#submit_beach_conditions');
When my form is completed and submitted it should redirect back to the form like so
$self->redirect_to('beach_conditions_form');
This is when I get my error! The error is along the lines of
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are "[Wed Jun 28 15:26:22 2017] [debug] Reading configuration file "D:\inetpub\wwwroot\beach_conditions\beach_conditions.conf" [Wed Jun 28 15:26:22 2017] [debug] POST "/conditions_form" [Wed Jun 28 15:26:22 2017] [debug] Routing to controller "BeachConditions::Controller::Account" and action "is_logged_in" [Wed Jun 28 15:26:22 2017] [debug] Routing to controller "BeachConditions::Controller::Form" and action "submit_beach_conditions" [Wed Jun 28 15:26:22 2017] [error] DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column 'OBS_DT', table 'BeachSafety.dbo.BEACH_CONDITIONS'; column does not allow nulls. INSERT fails. (SQL-23000) [state was 23000 now 01000] [Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated. (SQL-01000) [for Statement "INSERT INTO BEACH_CONDITIONS ( beach_current, flag_color, note, obs_dt, obs_loc, rip_current_risk, water_temp, wave_height, wave_type, weather, wind_direction, wind_speed) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) SELECT SCOPE_IDENTITY()" with ParamValues: 1=undef, 2=undef, 3=undef, 4=undef, 5=undef, 6=undef, 7=undef, 8=undef, 9=undef, 10=undef, 11=undef, 12=undef]
Which to me, means it just skipped over the GET method and straight to the POST....
If I hard code the path, all is good (but all is not good, because it's hard coded....).
This works..
$self->redirect_to('http://server/beach_conditions/beach_conditions.pl/conditions_form');
I found this, but not much help.
https://groups.google.com/forum/#!topic/mojolicious/IPJopdGCdKQ
Thank you for any information.