Skip to content

Instantly share code, notes, and snippets.

@alexyork
Created May 19, 2011 19:34
Show Gist options
  • Save alexyork/981542 to your computer and use it in GitHub Desktop.
Save alexyork/981542 to your computer and use it in GitHub Desktop.
A very simple HTTP handler in .NET that returns JSON
using System;
using System.Web;
public class MyJsonHttpHandler : IHttpHandler
{
public bool IsReusable
{
get { return false; }
}
public void ProcessRequest(HttpContext context)
{
context.Response.Write("{ foo: 'bar' }");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment