How to implement this code in Delphi

Please discuss general Delphi programming topics here.

How to implement this code in Delphi

Postby kavkaz23 » July 18th, 2018, 6:18 pm

Hello board! Please point me to the right direction. I have some VBA code (from Excel) and I want to implement this code in Delphi (actually C++Builder, but I'm fluent in Delphi, so). How to go about it?

Code: Select all
    Set http = CreateObject("MSXML2.XMLHTTP")
    http.Open "GET", "https://d." & sourcer & "x/feed/f_1_" & dayzone & "_" & timezone & "_ru_1", False
    http.setRequestHeader "X-Fsign", "SW9D1eZo"
    http.Send
    fs_input = http.ResponseText


Thus far I have the following.

Code: Select all
  WideString source(lbSource->Items->Strings[lbSource->ItemIndex]);   // TLabelBox lbSource, 'soccerstand.com'
  WideString dayzone("0");
  WideString timezone("3");
  WideString url("https://d." + source + "/ru/x/feed/f_1_" + dayzone + "_" + timezone + "_ru_1");

  TStream* response = new TStream;
  TNameValueArray headers;                // how to http.setRequestHeader "X-Fsign", "SW9D1eZo"

  NetHTTPRequest1->Get(url, response, headers);   

  delete response;



I'm stuck! But I know I'm close to my goal.
kavkaz23
Member
Member
 
Posts: 1
Joined: July 18th, 2018, 6:04 pm

Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 3 guests