我有W3C提供的css-valdator.war,它在JBoss上本地运行。
我编写了一个非常快速的脚本来测试它:
require 'net/http'
require 'uri'
doc = '
* html {
font-family: tahoma;
background-color: black;
}
'
res = Net::HTTP.post_form(URI.parse('http://localhost:8080/css-validator/validator'),
{'uri' => 'none', 'profile' => 'css2','usermedium' => 'all', 'type' => 'none', 'lang' => 'en', 'warning' => '1', 'output' => 'soap12', 'text' => doc})
response = res.body
puts response当我浏览到我的web浏览器中的验证器时,我可以很好地粘贴CSS,它可以很好地验证,但是当我运行这个脚本时,我会看到一个错误页面,上面写着:
I/O错误:您发送了一个无效的请求。
我已经检查了我正在传递的参数,它们看起来很好。
有人知道为什么会发生这种事吗?
发布于 2009-09-02 12:53:35
我找到了一个名为w3c_validators的gem,它提供CSS、标记和提要验证。
gem install w3c_validatorshttps://stackoverflow.com/questions/1340801
复制相似问题