Skip to content

Instantly share code, notes, and snippets.

View pierceray's full-sized avatar

Ray Pierce pierceray

View GitHub Profile
var callback = context.HttpContext.Request.QueryString.AllKeys.FirstOrDefault(k => k == "callback");
var data = "{ "key": "value" }"; // JSON payload
if(string.IsNullOrEmpty(callback))
{
response.ContentType = "application/json";
response.AddHeader("Access-Control-Allow-Origin", "*";
response.Write(data);
}
else