Exec-command does not deliver full set of data

Hi,
I try to send a curl - command with several options using the exec-command for receiving the access token (with thousands of characters) for an API Interface.
The command looks like this:

<curl -v --url "https://api.xxxx.com/management-api/oauth/token" \ --header 'accept: application/json' \ --header 'authorization: Basic bWFpbEBnZS1iZW5rZXIuZGU6MTlwcDFla3M3OQ==' \ --header 'content-type: application/json' \ --data ' { "grant_type": "client_credentials" } '>

When sending the command, I receive only a part of the token, than the transfer stops after several hundred characters with "...".
The exec command shows "error 3", although it works basically.
Sending the same command using the command line interface, everything is ok and I get the complete token with correct data.
What do I have to change to get the whole access token characters using the exec-command?
Gerhard

stderr output:
stderr-output shows:

  • Expire in 0 ms for 6 (transfer 0x171950)

  • Expire in 1 ms for 1 (transfer 0x171950)
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed

    0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Expire in 0 ms for 1 (transfer 0x171950)

  • Expire in 2 ms for 1 (transfer 0x171950)

  • Expire in 0 ms for 1 (transfer 0x171950)

  • Expire in 0 ms for 1 (transfer 0x171950)

  • Expire in 2 ms for 1 (transfer 0x171950)

  • Expire in 1 ms for 1 (transfer 0x171950)

  • Expire in 1 ms for 1 (transfer 0x171950)

  • Expire in 4 ms for 1 (transfer 0x171950)

  • Expire in 1 ms for 1 (transfer 0x171950)

  • Expire in 1 ms for 1 (transfer 0x171950)

  • Expire in 4 ms for 1 (transfer 0x171950)

  • Expire in 2 ms for 1 (transfer 0x171950)

  • Expire in 2 ms for 1 (transfer 0x171950)

  • Expire in 4 ms for 1 (transfer 0x171950)

  • Expire in 2 ms for 1 (transfer 0x171950)

  • Expire in 2 ms for 1 (transfer...
    20.11.2022, 17:02:45node: 6990de2d.6eea9
    msg.payload : Object
    { code: 3, message: "Command failed: curl -v --url…"

Why are you spawning to curl? Why not simply use the built in HTTP Request node?

I tried to use the HTTP Request node, but I was not able to get it running with the necessary parameters.
... my missing knowledge
Gerhard

Where are you seeing that? If it is in a debug node then it may just be node red truncating the display to prevent flooding of the browser with data. In the debug node select Output to Console and the full message will appear in the log.

Yes, I see it in the debug node. However, writing it to memory shows exactly the same ending with "...". Also in the memory the token is not complete.

Problem solved. The limitation was the max. number of data shown in the debug-node. It was set to "1000" in the "settings.js". After setting it to "4000", the complete data set is displayed.
I also found a solution to use the HTTP-request, everything works fine.
Thanks for the helps.

Which is what I said. If you had sent it to the console as suggested then you would have seen it all.

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