Skip to content

Failed to deserialize content: Class::XSAccessor: invalid instance method invocant: no hash ref supplied at C:/Strawberry/perl/site/lib/Dancer2/Core/Role/Serializer.pm line 71. #16

@aibistin

Description

@aibistin

Getting this error trying to deserialize an 'axios' call :

Failed to deserialize content: Class::XSAccessor: invalid instance method invocant: no hash ref supplied at C:/Strawberry/perl/site/lib/Dancer2/Core/Role/Serializer.pm line 71.

This is the dumped headers:

Headers: bless({
"accept" => "application/json, text/plain, /",
"accept-encoding" => "gzip, deflate, br",
"accept-language" => "en-US,en;q=0.8",
"connection" => "keep-alive",
"content-length" => 123,
"content-type" => "application/json",
"dnt" => 1,
"host" => "localhost:5000",
"origin" => "http://localhost:5000",
"referer" => "http://localhost:5000/net/add/switch_end_point",
"user-agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36",
}, "HTTP::Headers::Fast")

This is the 'request->content' (which I was able to deserialize using 'from_json()':

""name":"test","device":"one","slot":"two","port":"three","interface_type":"four","description":"five","switch_type":"six"}"

I am using the latest versions of both Dancer2 and Dancer2::Plugin::REST

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions