Just a quick note - from the field. There's two things to watch out for - Is the payload TEXT (JSON is also TEXT) or BINARY (preferred).

  1. The Base64 encoding will be different for TEXT vs. BINARY. To get the escape characters etc. correct, it is better for the message to be in BINARY format
  2. The SIZE of the encoded message may throw an error (HTTPS limitation on buffer size - 4kb).
  3. Ensure that the \r is used as the SEGMENT delimiter (Prior to parsing).