Cannot perform post data operation in winhttp

Discussion in 'Wireless Networking' started by nirav vasa, Apr 26, 2007.

  1. nirav vasa

    nirav vasa Guest

    I M USING WINHTTP :

    I want to post a few credentials to this URL :

    https://rws-ag1.imaac.com:1112/usgw/processes


    this the example of the credentials i need to post :

    FNAME=0&IP=a.b.c.d&OS=http://www.google.com&prefix=&RLF=&username=abcd&password=*****&button=Login


    Could any one suggest the winhttp code i need to use to perform this operation.

    I m mostly confused with the port number that i should use to perform this operation.


    I m almost certain that the credentials should be a part of the header...


    This is the code that i m using....
    can u suggest some corrections... coz my code doesn't seem to work



    // Use WinHttpOpen to obtain a session handle.
    hSession = WinHttpOpen( L"iPassConnect",
    WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
    WINHTTP_NO_PROXY_NAME,
    WINHTTP_NO_PROXY_BYPASS, 0);





    // Specify an HTTP server.
    if (hSession)
    hConnect = WinHttpConnect( hSession, L"rws-ag1.imaac.com",
    1112, 0);


    if (hConnect)
    hRequest = WinHttpOpenRequest( hConnect, L"POST", L"/usg/process",
    NULL, WINHTTP_NO_REFERER,
    WINHTTP_DEFAULT_ACCEPT_TYPES, 0);


    if( hRequest )
    bResults = WinHttpAddRequestHeaders( hRequest, L"FNAME=0&IP=a.b.c.d&OS=http://www.google.com&prefix=&RLF=&username=abcd&password=*****&button=Login",
    -1,
    WINHTTP_ADDREQ_FLAG_ADD );


    if (hRequest)
    bResults = WinHttpSendRequest( hRequest,
    WINHTTP_NO_ADDITIONAL_HEADERS, 0,
    WINHTTP_NO_REQUEST_DATA, 0,
    0, 0);


    if (bResults)
    bResults = WinHttpReceiveResponse( hRequest, NULL);




    EggHeadCafe.com - .NET Developer Portal of Choice
    http://www.eggheadcafe.com
    nirav vasa, Apr 26, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    4
    Views:
    599
  2. Roy Galutia
    Replies:
    0
    Views:
    445
    Roy Galutia
    Aug 6, 2004
  3. G-man
    Replies:
    1
    Views:
    11,644
    Walter Roberson
    Oct 17, 2004
  4. Ch. Rajinder Nijjhar Jatt

    Cannot perform the scandisk

    Ch. Rajinder Nijjhar Jatt, Jul 20, 2005, in forum: Computer Support
    Replies:
    5
    Views:
    707
    Paul B.
    Jul 21, 2005
  5. =?Utf-8?B?U3JpcmFt?=

    Perform - cannot connect to x64 from x32.

    =?Utf-8?B?U3JpcmFt?=, Aug 15, 2006, in forum: Windows 64bit
    Replies:
    3
    Views:
    1,426
    Darrell Gorter[MSFT]
    Aug 16, 2006
Loading...

Share This Page