Thanks, John - in case this helps someone else, here is the code I use in my ASHX file:
public override void ProcessRequest(HttpContext context)
{
var strURL = context.Server.UrlDecode(context.Request["url"]);
WebResponse objResponse = default(WebResponse);
WebRequest objRequest = default(WebRequest);
string result = null;
objRequest = HttpWebRequest.Create(strURL);
objResponse = objRequest.GetResponse();
StreamReader sr = new StreamReader(objResponse.GetResponseStream());
result = sr.ReadToEnd();
sr.Close();
context.Response.ContentType = "application/json";
context.Response.Write(result);
context.Response.Flush();
}
However, I received a couple of extra characters (unlike the version that came straight from Yahoo! Pipes), so I had to delete them before parsing JSON.
source
share