MXS-1220: Pretty-print by default
The REST API now pretty-prints by default. This is done to make it easier to use the API with browsers that don't have an integrated REST API client.
This commit is contained in:
@ -121,7 +121,14 @@ int Client::process(string url, string method, const char* upload_data, size_t *
|
|||||||
|
|
||||||
if (js)
|
if (js)
|
||||||
{
|
{
|
||||||
int flags = request.get_option("pretty") == "true" ? JSON_INDENT(4) : 0;
|
int flags = 0;
|
||||||
|
string pretty = request.get_option("pretty");
|
||||||
|
|
||||||
|
if (pretty == "true" || pretty.length() == 0)
|
||||||
|
{
|
||||||
|
flags |= JSON_INDENT(4);
|
||||||
|
}
|
||||||
|
|
||||||
data = mxs::json_dump(js, flags);
|
data = mxs::json_dump(js, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user