Click here to Skip to main content
15,904,638 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Resizing of form view - problem Pin
BlackDice1-Oct-04 3:52
BlackDice1-Oct-04 3:52 
GeneralAdd a scroll bar to Mainframe Pin
ledallam30-Sep-04 20:26
ledallam30-Sep-04 20:26 
GeneralRe: Add a scroll bar to Mainframe Pin
Iain Clarke, Warrior Programmer30-Sep-04 22:58
Iain Clarke, Warrior Programmer30-Sep-04 22:58 
GeneralCopy a File Pin
tgprakash30-Sep-04 19:57
tgprakash30-Sep-04 19:57 
GeneralRe: Copy a File Pin
BlackDice1-Oct-04 4:05
BlackDice1-Oct-04 4:05 
GeneralCORRECTION Pin
BlackDice1-Oct-04 4:07
BlackDice1-Oct-04 4:07 
GeneralRe: CORRECTION Pin
tgprakash3-Oct-04 20:04
tgprakash3-Oct-04 20:04 
Generalto send a http POST request to the url or server Pin
Nison Jose30-Sep-04 19:56
Nison Jose30-Sep-04 19:56 
I want to send a http POST request to a given url.How can I get it done. I usually use the CInternetSession class to
connect to a server and to get the specified page.From that page I go to the next page by fetching the next page's url
from the href of the SUBMIT button.

One day I get a page.But when clicked manually on the NEXT button (SUBMIT button of html) the url in the address bar do not change but the page is changed. Neither I found any url in the web page(source of page) also.

I come to know that this is because the page uses the POST method and by using the hidden values posted from the page the sever is dynamically moving to next page
Is it true.
Since user is not given any values in the page,can I get the next page by sending a POST request to the server using program.
Can we send a POST request to the server through VC++.

Plz help me and give any answer
Thanks in advance

Below shown the code . If you implement that in the code ,
it will be a good help for me

const int FILEBUFLEN = 1024;
char httpBuff[FILEBUFLEN+1];
TCHAR szCause[255];

/// var: url ,contains the url
TRY
{

CInternetSession session;
int numBytes;

session.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 1000);
session.SetOption(INTERNET_OPTION_CONNECT_RETRIES, 3);
CFile *remoteFile=session.OpenURL(url, 1 , INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_RELOAD);

numBytes = remoteFile->Read(httpBuff, FILEBUFLEN);
while (numBytes)
{
httpBuff[numBytes]='\0';
data.Insert(data.GetLength()+10,httpBuff);
numBytes = remoteFile->Read(httpBuff, FILEBUFLEN);
}


}
CATCH_ALL(error)
{
error->GetErrorMessage(szCause,254,NULL);
data.Format("%s",szCause);
Logger logVar;
logVar.WriteLog(data);
return FALSE;

}
END_CATCH_ALL;

return true;

Now I want to give a post request to this page.I saw
an option in CHttpConnection::openRequest() to post request in POST method.I tried it But the fifth parameter is not working.If it is NULL then it will work.




GeneralRe: to send a http POST request to the url or server Pin
ThatsAlok1-Oct-04 18:37
ThatsAlok1-Oct-04 18:37 
GeneralCopy a File Pin
tgprakash30-Sep-04 19:53
tgprakash30-Sep-04 19:53 
GeneralRe: Copy a File Pin
4apai30-Sep-04 20:51
4apai30-Sep-04 20:51 
GeneralRe: Copy a File Pin
tgprakash3-Oct-04 20:02
tgprakash3-Oct-04 20:02 
GeneralCEdit Pin
Neelesh K J Jain30-Sep-04 19:27
Neelesh K J Jain30-Sep-04 19:27 
GeneralRe: CEdit Pin
Sujan Christo30-Sep-04 21:55
Sujan Christo30-Sep-04 21:55 
GeneralRe: CEdit Pin
Neelesh K J Jain30-Sep-04 22:28
Neelesh K J Jain30-Sep-04 22:28 
GeneralHelp needed...."Debug Assertion Failed!" Pin
Kiran Satish30-Sep-04 19:04
Kiran Satish30-Sep-04 19:04 
GeneralRe: Help needed...."Debug Assertion Failed!" Pin
Sujan Christo30-Sep-04 19:26
Sujan Christo30-Sep-04 19:26 
GeneralRe: Help needed...."Debug Assertion Failed!" Pin
Kiran Satish1-Oct-04 4:15
Kiran Satish1-Oct-04 4:15 
Question? Pin
Yulianto.30-Sep-04 18:57
Yulianto.30-Sep-04 18:57 
AnswerRe: ? Pin
PJ Arends30-Sep-04 19:01
professionalPJ Arends30-Sep-04 19:01 
GeneralRe: ? Pin
Yulianto.30-Sep-04 19:13
Yulianto.30-Sep-04 19:13 
GeneralRe: ? Pin
PJ Arends30-Sep-04 19:28
professionalPJ Arends30-Sep-04 19:28 
Generalmulti level indexing project Pin
AR50Guy30-Sep-04 18:32
AR50Guy30-Sep-04 18:32 
GeneralRe: multi level indexing project Pin
4apai30-Sep-04 20:42
4apai30-Sep-04 20:42 
GeneralChange CDialog Caption Height Pin
Fantmx30-Sep-04 17:51
Fantmx30-Sep-04 17:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.