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