Thanks Ryan...

I went through the link u given and i made an HTTPS request in vc+
+ .....
but i m not getting token in response.....Should i follow SSL protocol
if yes then how to do it.........

following is my code:



CInternetSession cInternetSession( NULL,
                                   1,
                                   INTERNET_OPEN_TYPE_PROXY |
INTERNET_SERVICE_HTTP,
                                   L"www.google.com",
                                   NULL,
                                   NULL );


                CHttpConnection* pDistantServerHttpConnection = NULL;

                CHttpFile* pHTTPFile = NULL;

                INTERNET_PORT nPort = INTERNET_DEFAULT_HTTPS_PORT;   // HTTPS

                LPCTSTR pT[2];
                pT[0] = L"application/x-www-form-urlencoded";
                pT[1] = '\0';

                pDistantServerHttpConnection =
cInternetSession.GetHttpConnection( L"www.google.com", nPort );
                pHTTPFile = pDistantServerHttpConnection->OpenRequest(
CHttpConnection::HTTP_VERB_POST ,
                                                                                
                                                  
L"https://www.google.com/accounts/ClientLogin";,
                                                                                
                                                  NULL,
                                                                                
                                                  1,
                                                                                
                                                  pT,
                                                                                
                                                  L"HTTP/1.0",
                                                                                
                                                  INTERNET_FLAG_SECURE );

                if(pHTTPFile != NULL)
                {
                        CURLEncode url_encode; // it performs URL encoding.....

                        CString strHeader = L"Content-type: 
application/x-www-form-
urlencoded\r\n";
                        BOOL bret = pHTTPFile->AddRequestHeaders(strHeader );

                        CString strOption =
L"accountType=GOOGLE&[EMAIL PROTECTED]&Passwd=harishiit&service=cl&source=DoMo-
TempPlugIn-1.0.0.1";
                        CString strOptionEn = url_encode.URLEncode(strOption);
                         bret = pHTTPFile->SendRequest(NULL, 0, (LPVOID)
(LPCTSTR)strOptionEn, strOptionEn.GetLength ());

                        DWORD dwRet;
                        bret = pHTTPFile->QueryInfoStatusCode(dwRet);

                        CString strData = L"";
                        CString strResp ;
                        UINT nBytesRead;
                        char szBuff[1024];
                        memset(szBuff , 0 , sizeof(szBuff));

                        while ((nBytesRead = pHTTPFile->Read(szBuff, 1023)) > 0)
                        {
                                szBuff[nBytesRead] = '\0';
                                CString strT(szBuff);
                                //strT.Trim();
                                strData += strT;
                                memset(szBuff , 0 , sizeof(szBuff));
                        }

                        pHTTPFile->Close();
                        pDistantServerHttpConnection->Close();
                        cInternetSession.Close();
                }

        }
        catch (CInternetException* pEx)
    {
        pEx->ReportError();
        pEx->Delete();
    }

In response just i m getting google sign in page....
This code have any prob then plz help me..

Thanks

Harry


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Data API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to