connection to server, & make GET/POST request in vc++

R

rup

Hello,
This is my first application on socket programming in vc++. I am facing

problem that how to make connection to server, & make GET/POST request
by HTTP.
Please help me. Its urgent....
Thanks
 
J

Jim Langston

rup said:
Hello,
This is my first application on socket programming in vc++. I am facing

problem that how to make connection to server, & make GET/POST request
by HTTP.
Please help me. Its urgent....
Thanks

OT in comp.lang.c++ but I"m feeling generous.

A windows socket class:
http://www.adp-gmbh.ch/win/misc/sockets.html

In use I am using this to request a HTTP file:
Socket->SendLine(( HeaderOnly ? "HEAD " : "GET " ) + DLFileName + "
HTTP/1.0");
Socket->SendLine("Host: " + Host);
Socket->SendLine("");

Any other questions, please ask in a VC++ newsgroup.
 
R

rup

Jim said:
OT in comp.lang.c++ but I"m feeling generous.

A windows socket class:
http://www.adp-gmbh.ch/win/misc/sockets.html

In use I am using this to request a HTTP file:
Socket->SendLine(( HeaderOnly ? "HEAD " : "GET " ) + DLFileName + "
HTTP/1.0");
Socket->SendLine("Host: " + Host);
Socket->SendLine("");

Any other questions, please ask in a VC++ newsgroup.

Thanks Jim Langston for your reply. But can u give me some clear idea .
Here is my code for your consideration.
CSocket m_SockClient;
m_SockClient.Create();
BOOL success =FALSE;
success = m_SockClient.Connect("192.168.6.50",80);
if(success ==TRUE)
{ AfxMessageBox("connection established");
}

By doing this connection is established but I am not getting how to
make GET request via HTTP.
I will also send this message on vc++ group. Sorry for your inconvience.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top