24 lines
516 B
JavaScript
24 lines
516 B
JavaScript
const http = require('http');
|
|
|
|
const data = JSON.stringify({
|
|
pageId: '019dc96c-5f1b-7391-bd1e-1909fa793761',
|
|
quality: 1
|
|
});
|
|
|
|
const req = http.request({
|
|
hostname: 'localhost',
|
|
port: 3000,
|
|
path: '/api/pages/review',
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
'Content-Length': data.length
|
|
}
|
|
}, (res) => {
|
|
let body = '';
|
|
res.on('data', chunk => body += chunk);
|
|
res.on('end', () => console.log('Status:', res.statusCode, 'Body:', body));
|
|
});
|
|
req.write(data);
|
|
req.end();
|