My lovely little London Bus “app” (possibly the most basic web page you can imagine + connection to the Transport for London API) broke recently, and given the tube strike today I felt I the urge to fix it.
The error occurred when the web page called the proxy (to avoid Cross Origin Request errors there needs to be a server-side api proxy on the same domain as the html page) which calls the TFL API. The proxy is THE WORLD’S MOST BASIC PROXY
It’s just “File -> Add -> New Item -> Web Service (ASMX)”, with this single method:
[WebMethod]
public string getMeTheDataFrom(string here)
{
using (var response = new System.Net.WebClient())
{
return response.DownloadString(here);
}
}