MQL4 documentation webrequest example creates file, but with no text

 

I'm trying to just run the example code found in the MQL4 documenation for webrequest. I believe the code should connect to a website, pull the code, and write it to a file. When I execute the script I see a file appear, so it does get created, but there's not text in it, so possibly something wrong with the webrequest. 


void OnStart(){
   News newNews();
      newNews.getNews();
   }

class News{
   public:

   double getNews(){   
      string cookie=NULL,headers;
      char post[],result[];
      int res;
      string google_url="https://www.google.com/finance";
      ResetLastError();
      int timeout=5000; 
      res=WebRequest("GET",google_url,cookie,NULL,timeout,post,0,result,headers);
      if(res==-1){
         Print("Error in WebRequest. Error code  =",GetLastError());
         MessageBox("Add the address '"+google_url+"' in the list of allowed URLs on tab 'Expert Advisors'","Error",MB_ICONINFORMATION);
      }
      else{
         PrintFormat("The file has been successfully loaded, File size =%d bytes.",ArraySize(result));
         const string path = "fractals.txt";
         Print(TerminalInfoString(TERMINAL_COMMONDATA_PATH),"");
         Alert(path);
         int filehandle=FileOpen(path,FILE_COMMON|FILE_WRITE|FILE_TXT);
        if(filehandle!=INVALID_HANDLE){
            FileWriteArray(filehandle,result,0,ArraySize(result));
            FileClose(filehandle);
            Alert("OK");
        }
      else Print("Error in FileOpen. Error code=",GetLastError());
     }
     return true;
  };
};
 
That is not the code that is in the example.
 
that worked. thanks.
Reason: