OpenSim.Framework.WebUtil.SendJSONResponse C# (CSharp) Method

SendJSONResponse() public static method

Send LLSD to an HTTP client in application/llsd+json form
public static SendJSONResponse ( OpenSim.Framework.Servers.HttpServer.OSHttpResponse response, OSDMap body ) : void
response OpenSim.Framework.Servers.HttpServer.OSHttpResponse HTTP response to send the data in
body OSDMap LLSD to send to the client
return void
        public static void SendJSONResponse(OSHttpResponse response, OSDMap body)
        {
            byte[] responseData = Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(body));

            response.ContentEncoding = Encoding.UTF8;
            response.ContentLength = responseData.Length;
            response.ContentType = "application/llsd+json";
            response.Body.Write(responseData, 0, responseData.Length);
        }