ePages 7.47.0 - DE_EPAGES/WebService/API/Codec/JSON.pm

Package DE_EPAGES::WebService::API::Codec::JSON

Codec for handling HTTP::Message objects with JSON content.

Functions

decode
encode
new

decode

Returns the decoded content of the message.

Syntax
$Data = $Codec->decode($Message);
Input
$Message (HTTP::Message)
HTTP request or response object
Return
$Data (ref)
decoded data

encode

Encodes the data and sets the content of the message.

Syntax
$Codec->encode($Message, $Data);
Input
$Message (HTTP::Message)
HTTP request or response object
$Data (ref)
decoded data

new

Creates a new JSON codec for HTTP messages.

Syntax
$Codec = DE_EPAGES::WebService::API::Codec::JSON->new(%Options);
Input
%Options (hash)
options:
  • ContentType - (optional, default=application/json) content-type - string
Return
$Codec (DE_EPAGES::WebService::API::Codec::JSON)
codec object