Sha256: 1b5147d6a77a595d45525547326ae5ff654ef7f383b105c555736d3f588f93ef
Contents?: true
Size: 640 Bytes
Versions: 1
Compression:
Stored size: 640 Bytes
Contents
var http = require('http'); exports.callRedPen = function (request, assertion) { var options = { hostname: 'localhost', port: 8080, path: '/rest/document/validate/json', method: 'POST', headers: {'Content-Type': 'application/json'} }; var req = http.request(options, function (res) { var data = ''; res.on('data', function (chunk) { data += chunk; }); res.on('end', function () { errorSentences = JSON.parse(data).errors; assertion(errorSentences); }); }); req.write(JSON.stringify(request)); req.end(); }
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
redpen-0.2.0 | lib/redpen-distribution-1.7.0/js/test/redpen.js |