-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-bug.js
More file actions
36 lines (31 loc) · 776 Bytes
/
Copy pathtest-bug.js
File metadata and controls
36 lines (31 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const http = require('http');
const data = JSON.stringify({
title: "Test Bug from Node",
description: "This is a test bug created via a script to verify the backend API.",
projectId: "proj-123",
reporterId: "user-123",
reporterName: "Test User",
severity: "high",
status: "new"
});
const options = {
hostname: 'localhost',
port: 3000,
path: '/api/bugs',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': data.length
}
};
const req = http.request(options, (res) => {
console.log(`STATUS: ${res.statusCode}`);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (error) => {
console.error(error);
});
req.write(data);
req.end();