Hello
I send data to a cgi-bin script in JSON format using JSON::PP
my $url= $Server . "/cgi-bin/DB_NewTerm.pl"; my $data = { record => \@record}; my $request = POST($url, Content_Type=>'application/json', Content => encode_json($data) ); my $response = $ua->request($request); print $response->content, "\n";
One of the element of my @record is a date. And here seems to be the problem, since I get the following error:
Tk::Error: encountered object '2019-12-23', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled (or TO_JSON/FREEZE method missing)Why is this data considered an issue?
Edit
This produces the error:
my @record=( $Tag1, $Tag2, $CommentAll, $today );
However, the following does not:
my @record=( $Tag1, $Tag2, $CommentAll, "$today" );
(Being $date the variable containing the date)
In reply to Json::PP data error by IB2017
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |