Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save micahasmith/2639215 to your computer and use it in GitHub Desktop.

Select an option

Save micahasmith/2639215 to your computer and use it in GitHub Desktop.

Revisions

  1. micahasmith revised this gist May 8, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nonasync-webrequest-httphandler.ashx.cs
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@ public void ProcessRequest (HttpContext context) {

    public bool IsReusable {
    get {
    return false;
    return true;
    }
    }
    }
  2. micahasmith created this gist May 8, 2012.
    20 changes: 20 additions & 0 deletions nonasync-webrequest-httphandler.ashx.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    public class nonasync_webrequest_test : IHttpHandler {

    public void ProcessRequest (HttpContext context) {
    var r = new RequestState()
    {
    Wr = WebRequest.Create("http://www.google.com"),
    Cxt = context
    };
    r.Wr.Method = "GET";
    var s= r.Wr.GetResponse();
    r.Cxt.Response.ContentType = "text/plain";
    r.Cxt.Response.Write(string.Format("Hello World async {0}", RequestState.ReadStream(s.GetResponseStream())));
    }

    public bool IsReusable {
    get {
    return false;
    }
    }
    }