http post request

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: so1o (anonymous_at_discussions.microsoft.com)
Date: 05/13/04


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



Relevant Pages

  • Perl POST
    ... The user presses a button. ... The website takes them to a page where they can ... The site (without displaying ... POST data to an URL and forward them to the website involved with the ...
    (perl.beginners)
  • Re: Is the end of HTML as we know it?
    ... I mean I think you should be able to design your website anyway ... Only stupid. ... the whole website (using POST data or AJAX to identify the location), ... no site map, without any structure of the pages or the content of the ...
    (alt.html)
  • Re: GetRequestStream blocks
    ... GetRequestStream method to send the POST data. ... I can successfully get through logging in, but there is a second post that ... If you want retrieve data from website you should consider ...
    (microsoft.public.dotnet.languages.csharp)
  • web query data post to ASP
    ... I have been using a web query to post data to a cgi ... but the website has switched to an ASP form. ...
    (microsoft.public.excel.programming)
  • Re: Where to define functions as global?
    ... happens when a browser requests a document from the server. ... the common way of building a website is ... main script. ...
    (alt.php)