Mojolicious every_param 没有为整数填充数组

Mojolicious every_param not populating array for integers

  my $warranty_dates  = $self->every_param('warranty_date');
  my $state_ids       = $self->every_param('state_id');

结果:

   $VAR1 = undef;

  $VAR1 = '12/12/2017';
  $VAR2 = '12/12/2017';
  $VAR3 = '12/12/2017';
  $VAR4 = '12/12/2017';
  $VAR5 = '12/12/2017';

分别被

调用时
  die Dumper(@{$state_ids});

  die Dumper(@{$warranty_dates});

尽管显示为具有以下参数:

  "state_id" => [
    1,
    1,
    1,
    1,
    1
   ],
  "warranty_date" => [
    "12/12/2017",
    "12/12/2017",
    "12/12/2017",
    "12/12/2017",
    "12/12/2017"

所以我找到了答案,那就是我没有将参数作为 post 请求。

https://corky.net/dotan/programming/mojolicious-request-parameters-example.html

快速解释为什么其中一些参数需要采用

格式
$self->req->every_param('');

Passing arguments to redirect_to in mojolicious and using them in the target controller