我试图让 Code Closure 工作,但不幸的是,总是抛出一个错误。
这是代码:
use LWP::UserAgent;
use HTTP::Request::Common;
use HTTP::Response;
my $name = 'test.js';
my $agent = new LWP::UserAgent();
$agent->agent("curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18");
$res = $agent->request(POST 'http://closure-compiler.appspot.com/compile',
content_type => 'multipart/form-data',
content => [
output_info => 'compiled_code',
compilation_level => 'SIMPLE_OPTIMIZATIONS',
output_format => 'text',
js_code => [File::Spec->rel2abs($name)]
]);
if ($res->is_success) {
$minified = $res->decoded_content;
print $minified;die;
}
我收到以下错误:
错误(13):没有输出信息可产生,但已请求编译。
这是我使用的 api 参考: http ://code.google.com/intl/de-DE/closure/compiler/docs/api-ref.html
希望有人知道这里出了什么问题。谢谢。