http post request
From: so1o (anonymous_at_discussions.microsoft.com)
Date: 05/13/04
- Next message: Doug Harrison [MVP]: "Re: Run-Time Dynamic Linking problem"
- Previous message: Vai2000: "Quick Question!"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 13 May 2004 10:41:10 -0700
Hello
i am trying to post data to a website. this is the code that i have written. the target page http://website.com/cgi-bin/quotes.pl does not take get requests.
// if we have a web browser pointer then try to navigate to site to retrieve stock quotes.
if (m_pBrowser)
{
VARIANT vEmpty;
VariantInit(&vEmpty);
m_pBrowser->Stop();
_bstr_t bsSite;
BSTR bstrTickers = NULL;
// if the user has entered stock quotes then append them to the url
if (m_EditWnd.GetWindowTextLength())
{
m_EditWnd.GetWindowText(bstrTickers);
//bstrTickers = "Content-Type: application/x-www-form-urlencoded\r\n" + bstrTickers;
bsSite = "http://website.com/cgi-bin/quotes.pl";
//bsSite += &bstrTickers;
SysFreeString(bstrTickers);
}
// if the user has not entered any stock quotes then just take them to website.
else
bsSite = "http://website.com/";
// have the webrowser navigate to the site URL requested depending on user input.
VARIANT vData = {0};
V_VT(&vData) = VT_BSTR;
V_BSTR(&vData) = SysAllocString(L"Words=MSO");
VARIANT vHeaders = {0};
V_VT(&vHeaders) = VT_BSTR;
V_BSTR(&vHeaders) = SysAllocString(L"Content-Type: application/x-www-form-urlencoded\r\n");
m_pBrowser->Navigate(bsSite, &vEmpty, &vEmpty,&vData,&vHeaders);
}
this code takes me to the website but does not post the data - i am assuming it is not posting since i am not getting the output.
Please can any telll me what is that is wrong in the code.
regards
So1o
- Next message: Doug Harrison [MVP]: "Re: Run-Time Dynamic Linking problem"
- Previous message: Vai2000: "Quick Question!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|