public void http_client_adv() { var j = new JsonParser(); string url = "https://openbookmobile.etoro.com/api/login"; string header = @"Content-Type::application/x-www-form-urlencoded; charset=utf-8,, User-Agent::OpenBook/2.1 (iPad Simulator; iOS 7.1; Scale/2.00)"; string mode = "POST"; string postdata = @"username=socialalert15&Password=123456m&appName=iOS&ver=2.1"; string str = "m=" + mode + " h=" + header + " u=" + url + " p=" + postdata; //string dbapiResult = HttpRequestExtensions.GetHTTPrequest(url); j.AddKeyToMemory(Constants.Memory, HttpRequestExtensions.GetHTTPrequestPost(str)); string line = @"$$Token j= Token"; j.VariableFunctions(line); str = j.replaceVariable("$$Token"); line = "https://openbookmobile.etoro.com/api/market?username=socialalert15&symbol=GOOG&appName=iOS&ver=2.1&period=180&code=en-gb&token=$$Token"; j.AddKeyToMemory(Constants.Memory, HttpRequestExtensions.GetHTTPrequest(line)); line = @"$$MarketValue j= MarketValue"; j.VariableFunctions(line); str = j.replaceVariable("$$MarketValue"); line = @"$$StockSummary j= StockSummary"; j.VariableFunctions(line); str = j.replaceVariable("$$StockSummary"); }
public void http_client() { var j = new JsonParser(); //string url = "https://fapi-real.etoro.com/instruments.json"; string url = "https://fapi-real.etoro.com/instruments/1"; //string dbapiResult = HttpRequestExtensions.GetHTTPrequest(url); j.AddKeyToMemory(Constants.Memory, HttpRequestExtensions.GetHTTPrequest(url)); string line = @"$$instrumentData j= InstrumentName"; j.VariableFunctions(line); string str = j.replaceVariable("$$instrumentData"); j.VariableFunctions("$$DataSource = " + str); str = j.replaceVariable("$$memory"); line = @"$$instrumentData j= InstrumentName ==> $$DataSource"; j.VariableFunctions(line); str = j.replaceVariable("$$instrumentData"); }