Some more detail: $req
file: code/Validad::Tools::OX::Request 26: sub new_json_response { 27: my ( $self, $data, $header_hash, $status ) = @_; 28: my $headers = 29: ref($header_hash) 30: ? HTTP::Headers->new(%$header_hash) 31: : HTTP::Headers->new; 32: $headers->header( 'content-type' => 'application/json;charset=utf-8' ); 33: $status ||= 200; 34: 35: return $self->new_response( 36: headers => $headers, 37: status => $status, 38: content => decode_utf8( encode_json($data) ), 39: ); 40: }
converts data to JSON