PerlでaxiosからJSONを受け取る
axios初めて使ったんですが、ものすごい簡単でびっくりしました。。
axios
GitHub - axios/axios: Promise based HTTP client for the browser and node.js
axios.post( './index.cgi', { "key": "value" } ).then( response => { console.log(response.data.key); } ).catch( error => { console.log(error) this.errored = true } ).finally( () => this.loading = false );
use CGI; use JSON::XS; my $param = decode_json($cgi->param('POSTDATA')); print $param->{key};