optionally convert the payload to json if the lib is available
updated the documentation