Initial commit - Stand 26.04.2026
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
const http = require('http');
|
||||
const id = '7985cf2a-e51d-4596-91b7-40f25bedb0c2';
|
||||
const data = JSON.stringify({ firmenname: 'Taeger IT' });
|
||||
const opts = {
|
||||
hostname: 'localhost',
|
||||
port: 3001,
|
||||
path: '/api/auftragsnachweise/' + id + '/pdf',
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', 'Content-Length': data.length }
|
||||
};
|
||||
const req = http.request(opts, r => {
|
||||
let d = '';
|
||||
r.setEncoding('binary');
|
||||
r.on('data', c => d += c);
|
||||
r.on('end', () => {
|
||||
console.log('Status:', r.statusCode);
|
||||
if (d.length > 1000) {
|
||||
console.log('PDF size:', d.length, 'bytes - OK');
|
||||
} else {
|
||||
console.log('Response:', d);
|
||||
}
|
||||
});
|
||||
});
|
||||
req.on('error', e => console.error(e));
|
||||
req.write(data);
|
||||
req.end();
|
||||
Reference in New Issue
Block a user