Untitled

mail@pastecode.io avatar
unknown
pascal
a year ago
935 B
81
Indexable
Never
procedure TForm1.FormCreate(Sender: TObject);

var
  HttpClient: TNetHTTPClient;
  Response: IHTTPResponse;
  URL: string;
  I: Integer;
   // Person: TDovizx;

       Personx:TMarket;


begin
  HttpClient := TNetHTTPClient.Create(nil);
  try
   // URL := 'https://api.ipbase.com/v1/json/';
    URL := 'https://api.canlidoviz.com/items/current?marketId=0&code=TRY&code=GA';
    Response := HttpClient.Get(URL);
    if Response.StatusCode = 200 then
    begin

     // Person := TDovizx.Create;

     // Person:=TJson.JsonToObject<TDovizx>(Response.ContentAsString);

     //  ShowMessage(Person.Ip);


        Personx :=  TMarket.Create;
        Personx:=TJson.JsonToObject<TMarket>(Response.ContentAsString);



      ShowMessage(Personx.Name);


    end
    else
    begin
      ShowMessage('Error: ' + Response.StatusCode.ToString);
    end;
  finally
    HttpClient.Free;
  end;

end;