/* Copyright (C) 2011, Stephane Bisaro, aka iri License : you can do what you want with this source code This code is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. */ /* Send a GET request to a specific url. http://www.scolring.org/files/doc_html/inetgeturl.html INETGetURL is asynchronous, the callback should be defined to get the response */ fun CBdownload (inet, datas, received, error)= if error == 0 then // download in progress ( let datas -> [d] in mutate datas <- [strcat d received]; 0 ) else if error == 1 then // download finished ( let datas -> [d] in _createpack d _getmodifypack "tutorials/network/request_get.html"; _fooS "Done !"; 0 ) else // an error occurs ( _fooS strcat "An error occurs : " itoa error; 0 );; fun main ()= _showconsole; INETGetURL _channel "http://www.google.com" 0 @CBdownload [""]; 0;;