Files
buchhaltung/test-post.js
T
2026-04-26 07:51:39 +02:00

29 lines
713 B
JavaScript

const http = require('http');
const data = JSON.stringify({
kunde_id: null,
datum: '2025-04-20',
anfahrt_km: '',
art_der_arbeit: ['Wartung'],
software_version: 'AEOS',
durchgefuehrte_arbeiten: 'Test',
geliefertes_material: '-',
anlage_betriebsbereit: 'voll',
stunden_ids: [],
abnahmebestaetigung_text: 'Test'
});
const opts = {
hostname: 'localhost',
port: 3001,
path: '/api/auftragsnachweise',
method: 'POST',
headers: { 'Content-Type': 'application/json', 'Content-Length': data.length }
};
const req = http.request(opts, r => {
let d = '';
r.on('data', c => d += c);
r.on('end', () => console.log(d));
});
req.on('error', e => console.error(e));
req.write(data);
req.end();