How to create user in openfire using restapi in nodeJs application?

This is a link to my Question. I am unable to find the error. So i thought may be community can help. Please help. thanks in advance.