HTTP Object

ICE Data Services -

HTTP Object
Previous  Top  Next

HTTP Object
The HTTP object allows EFS to open a file from a URL to import data for use within the EFS script. The HTTP functionality can be used to read text files (e.g., .txt, .htm, .html, .xml, etc.)


  1. It is highly recommended that you do not use the HTTP object within the main() function where it has the potential of being called on every new trade. Instead, use the HTTP object either in the preMain() function or in custom user functions that are only called when needed. Either call it once when the script initializes or call it when specific logic triggers.
  2. Always prefix the url in question with http://
  3. Always match the case of any files you are retrieving using HTTP() (i.e., MyFile.txt is not the same as myfile.txt).
  4. If a page is not downloading properly, try adding another forward slash ( / ) to any single forward slashes in the url (i.e.

HTTP Methods

URL of page to retrieve
read a line from page
check for end-of-file condition


var v = new HTTP(""); 
var v =new HTTP("" + getSymbol());
//After constructing the object, do something like this:
if( {
while(!v.eof()) {

//Here's an example of a custom function for 
//loading a text file from a URL, which can 
//be called from preMain(). 
//The MyFile.txt file would need to contain 6 
//numbers, each on a separate line. This example 
//populates a global array with the 6 numbers 
//from MyFile.txt.

var aArray = new Array(6);

function preMain() {

function loadData() {
var f = new HTTP("");
var i = 0;
if ( {
for (i = 0; i < 6; ++i) {
         aArray[i] = f.readln();
   f =