I have tried making the same post request using node-fetch and axios.
var fetch = require('node-fetch');
var axios = require('axios');
async function fetchTest(host, port, body) {
    const response = {
        successMessage: '',
        errorMessage: ''
    }
    try {
        const streamResponse = await fetch(`${host}:${port}`, {
            method: 'post',
            body: JSON.stringify(body)
        })
        const jsonResponse = await streamResponse.json()
        response.successMessage = jsonResponse;
    } catch (error) {
        response.errorMessage = error;
    }
    return response;
}
async function axiosTest(host, port, body) {
    const response = {
        successMessage: '',
        errorMessage: ''
    }
    try {
        const jsonResponse = await axios({
            method: 'post',
            url: `${host}:${port}`, 
            data: body
        })
        response.successMessage = jsonResponse;
    } catch (error) {
        response.errorMessage = error;
    }
    return response;
}
async function test() {
    console.log(await fetchTest('http://127.0.0.1', '8801', { type: 'request', cmd: 'devices' }));
    console.log(await axiosTest('http://127.0.0.1', '8801', { type: 'request', cmd: 'devices' }));
}
test();
The request made with node-fetch works nicely. The request made with axios returns (IP address redacted with ...) an error:
{ successMessage: '',
  errorMessage:
   { Error: connect ECONNREFUSED ...:80
       at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1161:14)
     errno: 'ECONNREFUSED',
     code: 'ECONNREFUSED',
     syscall: 'connect',
     address: '...',
     port: 80,
     config:
      { adapter: [Function: httpAdapter],
        transformRequest: [Object],
        transformResponse: [Object],
        timeout: 0,
        xsrfCookieName: 'XSRF-TOKEN',
        xsrfHeaderName: 'X-XSRF-TOKEN',
        maxContentLength: -1,
        validateStatus: [Function: validateStatus],
        headers: [Object],
        method: 'post',
        url: 'http://127.0.0.1:8801',
        data: '{"type":"request","cmd":"devices"}' },
     request:
      Writable {
        _writableState: [WritableState],
        writable: true,
        _events: [Object],
        _eventsCount: 2,
        _maxListeners: undefined,
        _options: [Object],
        _redirectCount: 1,
        _redirects: [],
        _requestBodyLength: 39,
        _requestBodyBuffers: [],
        _onNativeResponse: [Function],
        _currentRequest: [ClientRequest],
        _currentUrl: 'http://.../',
        _isRedirect: true },
     response: undefined } }
What might be the reason? Am I doing something wrong?
EDITED with more info requested in comment:
The axios request fails the same way if I comment out the node-fetch request.
The node-fetch request returns:
{
    cmd: 'devices',
    payload: { devices: [Array] },
    type: 'response' },
}
Since I wrap the result in a response object, the console.log looks like
{ 
    successMessage:
    { 
        cmd: 'devices',
        payload: { devices: [Array] },
        type: 'response' 
    },
    errorMessage: '' 
}
