const http = require('http');
const payload = JSON.stringify({
jsonrpc: "2.0",
method: "tools/call",
params: {
name: "add_item_text",
arguments: {
content: "Test Entry from Verify Script",
path: "verify_script.txt"
}
},
id: 123
});
const options = {
hostname: '127.0.0.1',
port: 3000,
path: '/messages',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': payload.length
}
};
const req = http.request(options, (res) => {
console.log(`STATUS: ${res.statusCode}`);
res.on('data', (chunk) => {
console.log(`BODY: ${chunk}`);
});
});
req.on('error', (e) => {
console.error(`problem with request: ${e.message}`);
});
req.write(payload);
req.end();