Microsoft.AspNet.SignalR.PersistentConnection.SendJsonResponse C# (CSharp) Method

SendJsonResponse() private static method

private static SendJsonResponse ( Microsoft.AspNet.SignalR.HostContext context, string jsonPayload ) : System.Threading.Tasks.Task
context Microsoft.AspNet.SignalR.HostContext
jsonPayload string
return System.Threading.Tasks.Task
        private static Task SendJsonResponse(HostContext context, string jsonPayload)
        {
            var callback = context.Request.QueryString["callback"];
            if (String.IsNullOrEmpty(callback))
            {
                // Send normal JSON response
                context.Response.ContentType = JsonUtility.JsonMimeType;
                return context.Response.End(jsonPayload);
            }

            // Send JSONP response since a callback is specified by the query string
            var callbackInvocation = JsonUtility.CreateJsonpCallback(callback, jsonPayload);
            context.Response.ContentType = JsonUtility.JavaScriptMimeType;
            return context.Response.End(callbackInvocation);
        }