The Information Query (IQ) stanza is where the work is done in XMPP. Rather than being used in a fire-and-forget fashion like message stanzas, IQ requests represent a request for information or a request to set some piece of information. Therefore unlike message stanzas, they always return a response, even to inform the requester of an error.
There are two types of IQ requests: The GET
request, which is comparable with GET
in HTTP; and the SET
request, which, as you may have guessed, equates to a POST
, PUT
, or DELETE
in HTTP. The response stanzas come in the form of RESULT
or ERROR
.
Unlike message or presence stanzas, IQ stanzas also have the requirement of an id attribute, which is a unique identifier that allows the mapping of a response to the original request, since XMPP is asynchronous, and so responses may be returned out of order.
A typical IQ request might be from a client to a server to see what features it supports (like our entity capabilities from before, it works on...