toJson method

String toJson()

Converts the Data instance to a JSON string.

This method is used for serializing the data to JSON format.

Returns:

  • JSON string containing URL and data content

Implementation

String toJson() {
  return jsonEncode(toMap());
}