HTTP Request without Success


I'm trying to make the same request as this one, but with a CHANGE or FUNCTION node, and I can't get it... the server responds that it doesn't receive the USERNAME or the LEVEL...

NODEJS example:

var request = require('request');
var options = {
  'method': 'POST',
  'url': '
   &content=This is the sample content sent to test &to=3333333',
  'headers': {
  formData: {

request(options, function (error, response) {
  if (error) throw new Error(error);

I have tried with msg.payload.dlr with msg.dlr and nothing...
This is my Change node:

SET msg.dlr-method = POST
SET msg.dlr-url =
SET msg.dlr-level = 3
SET msg.dlr = YES
SET msg.payload.username = (I also tried without payload: msg.username)
SET msg.pauload.password = (I also tried without payload)
SET msg.payload.from = (I also tried without payload)
SET = (I also tried without payload)
SET msg.payload.content = (I also tried without payload)

No success so far...

If I program it in an HTTP Request Node with POST with this string: is the sample content sent to test&to =33333333

It works.

What I need is that these input parameters can be loaded independently: CONTENT, TO, FROM, USERNAME, PASSWORD, etc.

Can you help me (I'm learning this wonderful tool called Node-Red :wink:

The cookbook should be able to help you out.


I was tried without success too...

This is my function node:

msg.payload = "";
msg.headers = {};
msg.headers['username'] = 'xxxxxx';
msg.headers['password'] = 'xxxxxx';
return msg;

The error is the same : Error "Mandatory argument [username] is not found."

Any comment?

It looks like a GET request which is send as a post.

Could you try to put this in a function node:

let username = "myusername"  // or let username = msg.payload.username etc
let password = "mypassword"
let content  = "my content"
let to = "333333"
let from = "smsinfo"

let url  = `${username}&password=${password}&dlr-url=${from}&content=${content}&to=${to}`
return msg;

Attach it to a http-request node, set it to POST.

  • In 1st request (sending let username = "username" the error is the same:

Error "Mandatory argument [username] is not found."

  • In 2nd test, sending like this:
    let username = msg.payload.username
    let password = msg.payload.password
    let content = msg.payload.content
    let to =
    let from = msg.payload.from
    let url =${username}&password=${password}&dlr-url=${from}&content=${content}&to=${to}
    msg.url = url
    return msg;
    Is working :wink:

Thank you for your help!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.