Open a default browser and send a POST method using C++

Hello
I’d like advice on programming guru folks.

I want to use vc++ to open default browser on my pc and send POST method.
I have confirmed that this operation is possible in ie from a long time ago.
But I couldn’t find how to implement this in chrome and edge.
Please advise.

thank you.

my example code :

BOOL CMainDlg::InstanceCookieNavigate(const TCHAR* pszURL, LONG lWidth/* =0 */, LONG lHeight/* =0 */, BOOL bStylePopup/* =FALSE */, BOOL bTopMost/* =TRUE */, BOOL bSetCookie/* =TRUE */)
{	
	// IE7 
	CString strURL = _T("https://www.***.com/blank.htm");
	HWND    hWnd = NULL;
	CComPtr <IWebBrowser2> pBrowser = NULL;
	VARIANT vtEmpty;
	_bstr_t bstrUrl = strURL.AllocSysString();
	
	if ( FAILED ( pBrowser.CoCreateInstance(CLSID_InternetExplorer) ) )
	//	if ( FAILED( ::CoCreateInstance(CLSID_InternetExplorer, NULL, CLSCTX_SERVER, IID_IWebBrowser2, (void **)&pBrowser) ) )
	{
		// ::ShellExecute(NULL, _T("open"), _T("iexplore.exe"), pszURL, NULL, SW_SHOWNORMAL);
		::ShellExecute(NULL, _T("open"), pszURL, NULL, NULL, SW_SHOWDEFAULT);
	
		return FALSE;
	}
	
	
	VariantInit(&vtEmpty);
	
	pBrowser->Navigate(bstrUrl, &vtEmpty, &vtEmpty, &vtEmpty, &vtEmpty);
	
	if ( lWidth )
	pBrowser->put_Width(lWidth);
	if ( lHeight )
	pBrowser->put_Height(lHeight);
	if ( bStylePopup )
	{
		pBrowser->put_Resizable(VARIANT_FALSE);
		pBrowser->put_StatusBar(VARIANT_FALSE);
		pBrowser->put_MenuBar(VARIANT_FALSE);
		pBrowser->put_AddressBar(VARIANT_FALSE);
		pBrowser->put_ToolBar(0);
	}

	while ( 1 )	
	{
		READYSTATE WebState;
		HRESULT hLoopDone = pBrowser->get_ReadyState(&WebState);
	
		if ( SUCCEEDED(hLoopDone) && WebState == READYSTATE_COMPLETE )
			break;
	
		if ( FAILED(hLoopDone) )
		{
			::Sleep(1200);	
			break;
		}
	
		::Sleep(1);	
	}
	
	
	if ( bSetCookie && m_pszLoginCookie )
	{
		strURL.Format(
			_T("<form name='oLoginForm' id='oLoginForm'>")
			_T("<input type=hidden name='szWork' value=''>")
			_T("<input type=hidden name='szCookie' value=''>")
			_T("<input type=hidden name='szHref' value=''>")
			_T("</form>")
			_T("<script language=javascript>")
			_T("var obj= document.getElementById(\"oLoginForm\");")
			_T("obj.szWork.value=\"app_login\";")
			_T("obj.szCookie.value=\"%s\";")
			_T("obj.szHref.value=\"%s\";")
			_T("obj.method=\"post\";")
			_T("obj.action=\"https://login.***.com/app/login_app.php\";")
			_T("obj.submit();")
			_T("</script>"),
			m_pszLoginCookie,
			pszURL
			);
	}
	else
	{
		strURL.Format(
			_T("<form name='oLoginForm' id='oLoginForm'>")
			_T("<input type=hidden name='szWork' value=''>")
			_T("<input type=hidden name='szCookie' value=''>")
			_T("<input type=hidden name='szHref' value=''>")
			_T("</form>")
			_T("<script language=javascript>")
			_T("var obj= document.getElementById(\"oLoginForm\");")
			_T("obj.szWork.value=\"app_logout\";")
			_T("obj.szHref.value=\"%s\";")
			_T("obj.method=\"post\";")
			_T("obj.action=\"https://login.afreecatv.com/app/login_app.php\";")
			_T("obj.submit();")
			_T("</script>"),
			pszURL
			);
	}

	{	
		HRESULT			hResult			= 0;
		IDispatch*		pHtmlDispatch	= NULL;
		IHTMLDocument2*	pHtmlDoc		= NULL;
	
		hResult = pBrowser->get_Document(&pHtmlDispatch);
	
		if ( SUCCEEDED(hResult) && pHtmlDispatch )
		{
			hResult = pHtmlDispatch->QueryInterface(IID_IHTMLDocument2, (void**)&pHtmlDoc);

			if ( SUCCEEDED(hResult) && pHtmlDoc )	
			{
				// construct text to be written to browser as SAFEARRAY
				SAFEARRAY *psaData = SafeArrayCreateVector(VT_VARIANT, 0, 1);
				VARIANT *pvarData;
	
				SafeArrayAccessData(psaData, (LPVOID *)&pvarData);				

				pvarData->vt      = VT_BSTR;
				pvarData->bstrVal = strURL.AllocSysString();
				
	
				SafeArrayUnaccessData(psaData);
	
				// write SAFEARRAY to browser pDocument
				pHtmlDoc->write(psaData);
				pHtmlDoc->Release();
			}
			pHtmlDispatch->Release();
		}
	}

	pBrowser->put_Visible(TRUE);

	pBrowser->get_HWND( (SHANDLE_PTR *)&hWnd );
	if ( bTopMost)
		::SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
	else
		::SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

	return TRUE;
}