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:
parent
88bf361e61
commit
4c2560b5a6
@ -121,7 +121,14 @@ int Client::process(string url, string method, const char* upload_data, size_t *
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user