【问题标题】:How to implement advanced routing in perl dancer for RESTful webservices?如何在 perl dancer 中为 RESTful web 服务实现高级路由?
【发布时间】:2014-12-15 22:38:24
【问题描述】:

我想使用 perl dancer 实现一个 RESTful webservice 后端,并想了解我是否(最终如何)可以实现这样的 rest-enpoint:

get qr{/this/:IS/one/:PATH/with/:MANY/variables/:ONEMORE} => sub() {

  # Does perl dancer support this?
  # How to implement this and get the variables?

}

【问题讨论】:

    标签: perl web-services rest dancer


    【解决方案1】:

    好吧,我不知道为什么,但是使用qr{...} 不起作用,但是这种格式可以正常工作:

    get '/this/:IS/one/:PATH/with/:MANY/variables/:ONEMORE' => sub() {
      info("Variable IS = " . params->{IS});
    
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-06-04
      • 1970-01-01
      • 2014-04-23
      • 2010-10-04
      • 2017-12-20
      • 2014-05-25
      • 1970-01-01
      相关资源
      最近更新 更多