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?

1 Reply

@seowoolove Hi!  I believe you've already received some answers on Stack Overflow but I wanted to also pass on some information from the IE Retirement FAQ (https://techcommunity.microsoft.com/t5/windows-it-pro-blog/internet-explorer-11-desktop-app-retireme...) which might be helpful.  

 

  • I ran into issues with my application which utilizes IE through automation. Will this be fixed? (New: December 2, 2021)

As part of the IE 11 application retirement, certain COM automation scenarios were inadvertently broken. This issue has been addressed in beginning with the November 22, 2021 optional non-security update (KB500762). Plans to address this in a future Windows 10 update are underway. If you continue to experience issues after taking the update, please contact App Assure for remediation assistance. 

 

-Kelly