How to open a URL passing hidden parameter?

0

I need, via Delphi, to open a Url / Site by passing a hidden parameter (not shown in Url).

I tried ShellExecute:

ShellExecute(Handle, 'Open', 'http://localhost:49486/admin/Login.aspx?View={1B605F4E-A7C9-4B7B-98B7-5A2D2ADBD520}', nil, nil, 1);

But it only allows you to pass the parameter via url, making it visible.

    
asked by anonymous 21.11.2016 / 17:53

1 answer

2

I solved the problem using TWebBrowser:

procedure TForm1.Button1Click(Sender: TObject);
var Data: String;
    I: Integer;
    Flags, PostData, Headers: OleVariant;
begin

  Flags := navOpenInNewWindow;
  Data  := 'View={1B605F4E-A7C9-4B7B-98B7-5A2D2ADBD520}';
  PostData := VarArrayCreate([0, Length(Data)-1], varByte);
  for I := 1 to Length(Data) do PostData[I-1] := Ord(Data[I]);
  Headers := 'Content-Type: application/x-www-form-urlencoded' + #10#13;
  WebBrowser1.Navigate('http://localhost:49486/admin/Login.aspx', Flags, EmptyParam, PostData, Headers);

end;

The only detail is that it opens by default in the Internet Explorer browser.

    
21.11.2016 / 18:50