How can I open a webpage with post paramters and headers in Microsoft Edge ?

Copper Contributor

 

Internet Explorer 11 will be retired in June 2022, so I substitute Edge for Internet Explorer 11.

I used the COM object to open a webpage with post paramters and headers in Internet Explorer 11.

----------------------------------------------------------------------------------------------------------------------
<IE code Sample>

string param = "userid=xxxx;password=yyyy" ; // POST DATA

object oUrl = "http://www.xxxx.com";
object flags = new object();
object targetFramName = new object();
object vPost = encode.GetBytes(param);
object vHeaders = "Content-Type: application/x-www-form-urlencoded;charset=" + UTF8Encoding.UTF8.WebName + "\r\n";

SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorer();

ie.AddressBar = true;
ie.MenuBar = false;
ie.StatusBar = true;
ie.ToolBar = 0

ie.Navigate2(ref oUrl, ref flags, ref targetFramName, ref vPost, ref vHeaders);
ie.Visible = true;
-------------------------------------------------------------------------------------------------------------

But I don't know how I can do this in Microsoft Edge.

Could someone help me please?

 

0 Replies