Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in passing comma separated values in query TuyaContext.request #2

Closed
jj-theInvincible opened this issue Jul 21, 2021 · 1 comment

Comments

@jj-theInvincible
Copy link

jj-theInvincible commented Jul 21, 2021

This code says Invalid token:

let deviceIdArray = ["someid","someOtherId"]
let deviceList = deviceIdArray.join()
let statusResponse=  await tuya.request({
            path: `/v1.0/iot-03/devices/status`,
            method: 'GET',
           query:{
              device_ids: deviceList
        });

And this one works:

let deviceIdArray = ["someid","someOtherId"]
let deviceList = deviceIdArray.join()
let statusResponse= await tuya.request({
            path: `/v1.0/iot-03/devices/status?device_ids=${deviceList}`,
            method: 'GET',
        });`

Ideally, both imply same things, but looks like the query formation has some issue, using v2.0.2

@Erchoc
Copy link
Contributor

Erchoc commented Jul 27, 2021

Are you sure the second one will work properly?

you can upgrade to v2.0.6, the path parse err will be fixed.

@Erchoc Erchoc closed this as completed Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants