However what you're trying to do here - using the built in HTTP module for NB-IoT - won't work, as it isn't supported by Espruino at the moment. You will have to do all NB-IoT communication via AT commands for the time being.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I'm pretty sure the code in https://www.espruino.com/RAK8212 is tested and works.
However what you're trying to do here - using the built in HTTP module for NB-IoT - won't work, as it isn't supported by Espruino at the moment. You will have to do all NB-IoT communication via AT commands for the time being.
If the link that's provided (https://wolfgangklenk.wordpress.com/2018/10/12/espruino-on-rak8212-accessing-the-nb-iot-nb1-modem/) doesn't give you enough info, you should ask RAK for some examples of what AT commands need to be sent for NB-IoT communications.