This PR adds support for GetLegendGraphic responses encoded as JSON. It builds on previous work by @pblottiere, who added QgsLegendRenderer::exportLegendToJson for that exact purpose.
For example a GetLegendGraphic request with FORMAT=image/png producing the image
will produce the following with FORMAT=application/json
The icon image is encoded in base64, and directly displayable in a web page.
This feature was developed by Éric Lemoine