【问题标题】:How come with Catalyst::Controller::REST I get an error about content-type如何使用 Catalyst::Controller::REST 我收到有关内容类型的错误
【发布时间】:2015-08-13 16:57:30
【问题描述】:

Catalyst::Controller::REST 怎么会出现在对话框中

[info] Could not find a serializer for an empty content-type

而且,这个到浏览器

找不到您的客户端支持的 Content-Type。

我的包裹里有这行..

__PACKAGE__->config(default => 'text/yaml');

我也安装了YAML::SyckURI::Findper the docs

package Sampcat::Controller::Client::Holiday;

__PACKAGE__->config(default => 'text/yaml');                   

BEGIN { extends 'Catalyst::Controller::REST' }                 

sub holiday :Chained('../client') :Args :ActionClass('REST') {}

sub holiday_GET {                                              
  my ( $self, $c )  = @_;                                      
  $self->status_ok( $c, entity => {                            
    'foobar' => 1                                              
  } );                                                         
  $c->stash->{body} = "foo";                                   
}                                                              

【问题讨论】:

    标签: perl rest dispatcher catalyst


    【解决方案1】:

    RT for more information 上查看此错误

    ;tldr.. 改变

    __PACKAGE__->config(default => 'text/yaml');
    

    __PACKAGE__->config(default => 'text/x-json');
    

    暂时。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-10
    相关资源
    最近更新 更多