KevinBonnoron / node-red-contrib-freebox

4 stars 4 forks source link

Error with api node #10

Closed Zehir closed 3 years ago

Zehir commented 3 years ago

Hello,

I have an issue with the api node. On each call I get this big error;

post https://mafreebox.freebox.fr:443/api/v8undefined error: Error: Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream
    at createError (/config/node-red/node_modules/axios/lib/core/createError.js:16:15)
    at dispatchHttpRequest (/config/node-red/node_modules/axios/lib/adapters/http.js:71:23)
    at new Promise (<anonymous>)
    at httpAdapter (/config/node-red/node_modules/axios/lib/adapters/http.js:46:10)
    at dispatchRequest (/config/node-red/node_modules/axios/lib/core/dispatchRequest.js:52:10)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  config: {
    url: 'https://mafreebox.freebox.fr:443/api/v8undefined',
    method: 'post',
    data: _some_random_number_that_I_replace_in_case_it's_security_related,
    headers: {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/x-www-form-urlencoded',
      'X-Fbx-App-Auth': 'An auth token',
      'User-Agent': 'axios/0.21.1'
    },
    tran...

I have a Freebox Pop and I using node-red 1.2.9 with node-red-contrib-freebox 0.0.11

The connection and lan browser nodes works fine

KevinBonnoron commented 3 years ago

Hello,

Could you give me the flow you are using ? I think you are trying to use the api node without the msg.url parameter.

Thanks

Zehir commented 3 years ago

Hello,

Could you give me the flow you are using ? I think you are trying to use the api node without the msg.url parameter.

Thanks

Ah yes I just plug in an inject node without url parameters But I think you should check if the url parameter exist than throw a big stacktrace ;)

KevinBonnoron commented 3 years ago

It's done in the latest version on github, but i didn't make a new version on npm / nodered :) since this commit. I'am doing some changes and i will make a new revision soon.

BTW did that solve your issue ?

Zehir commented 3 years ago

I dit not test yet, I am not at my computer right now

Zehir commented 3 years ago

yes thanks