Skip to content

Instantly share code, notes, and snippets.

@takeshik
Created April 23, 2011 14:17
Show Gist options
  • Save takeshik/938638 to your computer and use it in GitHub Desktop.
Save takeshik/938638 to your computer and use it in GitHub Desktop.
return input.Do(a => a.Act("Body", ((HttpWebResponse) WebRequest.Create(a.GetValue<String>()).GetResponse())
.If(
r => (Int32) r.StatusCode < 300,
r => new Byte[r.ContentLength].Apply(b => r.GetResponseStream().Dispose(s => s.Read(b, 0, b.Length))),
r => new Byte[0]
))
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment