how to send an iq using satanza.js in react?

36 views Asked by At

I'm trying to send this stanza:

<iq to="bmp-develop.phoenix.mahsan.net" type="get" id="lkbxdjn">
  <query xmlns="urn:xmpp:staff:0" type="all" />
</iq>

I used the sendIQ method but it sends an empty iq stanza:

<iq to="bmp-develop.phoenix.mahsan.net" type="get" id="lkbxdjn"/>

What should i do? I tried this code:

client.sendIQ({
    to: "bmp-develop.phoenix.mahsan.net",
    type: "get",
    id: "lkbxdjn",
    children: [`<query xmlns="urn:xmpp:staff:0" type="all" />`]
  })
  .then((res) => console.log(res))
  .catch((er) => console.log(er));
0

There are 0 answers