fix for reports
This commit is contained in:
1 parent
40e25334fd
commit
6bbf0afbab
7 files changed
+210
-4
No files matched your search
@@ -0,0 +1,37 @@
|
||||
const http = require('http');
|
||||
|
||||
const postData = JSON.stringify({
|
||||
username: 'testuser',
|
||||
hash: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', // empty string hash
|
||||
role: 'student'
|
||||
});
|
||||
|
||||
const options = {
|
||||
hostname: 'localhost',
|
||||
port: 3000,
|
||||
path: '/addUser',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Content-Length': Buffer.byteLength(postData)
|
||||
}
|
||||
};
|
||||
|
||||
const req = http.request(options, (res) => {
|
||||
console.log(`Status: ${res.statusCode}`);
|
||||
console.log(`Headers: ${JSON.stringify(res.headers)}`);
|
||||
res.setEncoding('utf8');
|
||||
res.on('data', (chunk) => {
|
||||
console.log(`Body: ${chunk}`);
|
||||
});
|
||||
res.on('end', () => {
|
||||
console.log('No more data in response.');
|
||||
});
|
||||
});
|
||||
|
||||
req.on('error', (e) => {
|
||||
console.error(`Problem with request: ${e.message}`);
|
||||
});
|
||||
|
||||
req.write(postData);
|
||||
req.end();
|
||||
Reference in new issue
Block a user