encode method

String encode()

Implementation

String encode() {
  return cmd + jsonEncode(payload) + '\n';
}