It has to do with the scope of your variable ‘app’. Because you use let id = ... it is only available in the same scope. Your callback function uses a regular function definition, which changes the context. If you use a arrow function, it keeps the scope where it is defined.
So I think it works if you change your callback function definition:
app.request.post('https://example.com/app/article/' + id, function (res) {
to app.request.post('https://example.com/app/article/' + id, (res) => {
That could be a second problem as well indeed Probably you have a component file with only markup, which works in a template file. But in a component file that should be wrapped in <template> tags: