I'm trying to run simple example from "Javascript tools guide" :
reply = ""; conn = new Socket; // access Adobe’s home page if (conn.open ("www.adobe.com:80")) { // send a HTTP GET request conn.write ("GET /index.html HTTP/1.0\n\n"); // and read the server’s reply reply = conn.read(999999); conn.close(); } $.writeln(reply);
What i need to success connection? I'm tried to open socket with different url, port, encoding types . Always i got false in conn.open(). Please tell me how to create one simple request using Socket object. For example, script what get weather from openweathermap site using simple api(request with city name(q) and api key(appid)). Like this example url:
http://api.openweathermap.org/data/2.5/weather?q=London,uk&appid=2de143494c0b295cca9337e1e 96b00e0
Or any other example.
Thanks!