What data can be published using PubNub?

The message field in PubNub's publish method can contain any JSON serializable data, including:

  • {Objects}
  • [Arrays]
  • Numbers - 1, 2, 3...
  • "Strings"

Make sure you do not send special Python classes or functions. These will not serialize. String content can include any UTF-8 character single-byte and multi-byte.

IMPORTANT: And do NOT serialize the JSON. Send the JSON object as is and PubNub will serialize and deserialize it for you. Binary data must be base64 encoded first. All messages are limited to 32KB.