Converts a data object or array into a JSON formatted string.
Turns a piece of structured data, such as an object or a list, into a single JSON text string. Use this when a system you send data to, like a REST API, expects a JSON message rather than separate fields. By default the result is compact, on one line; you can switch on options to make it more readable or to leave forward slashes untouched.