By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,602 Members | 1,457 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,602 IT Pros & Developers. It's quick & easy.

connection to server via HTTP & GET/POST method in vc++

P: n/a
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

Jan 6 '07 #1
Share this Question
Share on Google+
10 Replies


P: n/a
rup wrote:
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
Since this is a Microsoft specific question, try posting to
comp.os.ms-windows.programming or one of the microsoft.* groups. Also
see the MSDN documentation.

Jan 6 '07 #2

P: n/a
santosh said:
rup wrote:
>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

Since this is a Microsoft specific question,
The fact that he's using VC++ is less significant, I think, than the fact
that he's trying to learn how to do network programming. His best bet is to
learn about sockets from "Unix Network Programming", with the minor tweaks
needed for getting it to work under Windows being a valuable part of the
learning experience. Then he can learn about HTTP from the relevant RFC.
try posting to
comp.os.ms-windows.programming
I've never heard of that group, and I suspect it doesn't exist. You probably
mean comp.os.ms-windows.programmer.win32

<snip>

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Jan 6 '07 #3

P: n/a

Richard Heathfield <rj*@see.sig.invalidwrote in message
news:HY*********************@bt.com...
santosh said:
rup wrote:
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
Since this is a Microsoft specific question,

The fact that he's using VC++ is less significant, I think, than the fact
that he's trying to learn how to do network programming. His best bet is
to
learn about sockets from "Unix Network Programming", with the minor tweaks
needed for getting it to work under Windows being a valuable part of the
learning experience.
Don't think so, dude...

Just because he THINKS his problem has to do with "socket
programming", what he specifically said he wanted to do was
"make a connection to a server, & GET/POST request by
HTTP".

This again is the old idea of somebody asking "how do I drive
to Chicago?", you tell them to learn how to cast an engine block...
Then he can learn about HTTP from the relevant RFC.
This will be a definite help, but here's the actual answer:

1. Go to the MSDN web-site, specifically you should try:
http://msdn.microsoft.com/library/de.../library/en-us
/wininet/wininet/portal.asp
2. Download the "wininet" API (or other equivalent Microsoft
Internet client-server API) for absolutely friggin' free
3. Use it as directed in the documentation (a knowledge of
HTTP is somewhat helpful here when trying to puzzle out
Microsoft's particular API implementation of Internet protocols)

The important thing is if he just wants to write an application that
GETs/POSTs information on the "Internet", that he not waste time
re-inventing the metallurgy of "sockets" and the HTTP protocols,
since it has already been done for him.

The other important warning I must give him is
to be very wary of the many "open source" goofball HTTP
non-implementations that infest the nooks and crannies of
the Internet, crap that doesn't work, crap that never will
work, half-written crap written by retards with idiotic non-documentation
that ultimately just says, "We're a bunch of retards who have
no idea how to implement Internet protocols but in the generous
spirit of 'open source' we'll let you waste your time trying to use
something that doesn't work."

I can personally vouch that the Microsoft stuff, once you puzzle
out how to use it, works, and works flawlessly...

And I should probably point out, in the spirit of "topicness",
that "wininet" and other Microsoft Internet APIs actually are
C++, and MUST be compiled by a C++ compiler...

---
William Ernest Reid

Jan 6 '07 #4

P: n/a
Bill Reid said:
>
Richard Heathfield <rj*@see.sig.invalidwrote in message
news:HY*********************@bt.com...
>santosh said:
rup wrote:
>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

Since this is a Microsoft specific question,

The fact that he's using VC++ is less significant, I think, than the fact
that he's trying to learn how to do network programming. His best bet is
to
>learn about sockets from "Unix Network Programming", with the minor
tweaks needed for getting it to work under Windows being a valuable part
of the learning experience.

Don't think so, dude...

Just because he THINKS his problem has to do with "socket
programming", what he specifically said he wanted to do was
"make a connection to a server, & GET/POST request by
HTTP".
He also made it very clear that he wants to write a sockets-based program.
This again is the old idea of somebody asking "how do I drive
to Chicago?", you tell them to learn how to cast an engine block...
No, it isn't, and you have made that mistake more than once. It's more like
teaching them how to drive (program sockets) and then giving them a route
map (the HTTP RFC).

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Jan 6 '07 #5

P: n/a

Richard Heathfield <rj*@see.sig.invalidwrote in message
news:zK******************************@bt.com...
Bill Reid said:
Richard Heathfield <rj*@see.sig.invalidwrote in message
news:HY*********************@bt.com...
santosh said:
rup wrote:
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

Since this is a Microsoft specific question,

The fact that he's using VC++ is less significant, I think, than the
fact
that he's trying to learn how to do network programming. His best bet
is
to
learn about sockets from "Unix Network Programming", with the minor
tweaks needed for getting it to work under Windows being a valuable
part
of the learning experience.
Don't think so, dude...

Just because he THINKS his problem has to do with "socket
programming", what he specifically said he wanted to do was
"make a connection to a server, & GET/POST request by
HTTP".

He also made it very clear that he wants to write a sockets-based program.
Anything you do with a network on a Unix or Windows box
is going to involve "sockets"! (Unless you choose to reinvent
THAT wheel too!) That doesn't mean you have to actually
deal with "sockets", any more than you have to deal with any
particular network card driver that will also be involved "under
the hood" when you write a networking application!

If this is a class exercise (which of course, it may very well
be), then his "urgent" request is gonna take at least a little while
to resolve, because as you note he first has to learn the general
concepts of "sockets", then he has to implement a specific
library (in this case, "winsock"), then he has to learn the HTTP
protocol, then he has to implement the whole friggin' HTTP protocol
from the ground up using his "sockets" library!

Considering there are goofballs out there who clearly haven't
been able to figure out how to do this as a "community effort"
for the better part of a decade, that's a hell of an "urgent" homework
assignment!
This again is the old idea of somebody asking "how do I drive
to Chicago?", you tell them to learn how to cast an engine block...

No, it isn't,
You don't KNOW that. A lot of people get confused when trying
to write an application that gets (or "posts") stuff using HTTP, they
mistakenly think that they DO have to implement it "from the ground
up" starting with the "sockets" library (I myself thought that for
several years, because it WAS true for several years)...if that's the
case, I'm just giving him the quickest ("urgent") way to solve the
problem...just tryin' to be helpful, is all...
and you have made that mistake more than once. It's more like
teaching them how to drive (program sockets) and then giving them a route
map (the HTTP RFC).
My analogy was apt, yours is a little more conceptually inept...teaching
somebody to "program sockets" is more like teaching somebody the
general concepts of assembly line manufacturing, then handing them a
set of "blueprints" (HTTP) for a car you want them to manufacture...but
it could have been a jet plane, or a train locomotive, or a golf cart...

Let me try to clear it up for you. His question is actually equivalent to:

"Hello,
This is my first application on I/O programming in C. I am
facing problem how to make connection to terminal,
& get words from user keyboard and send words to user screen.
Please help me. Its urgent...."

Now tell me: how you would answer THAT question?

---
William Ernest Reid

Jan 6 '07 #6

P: n/a
Bill Reid said:

<snip>
Let me try to clear it up for you.
Please don't bother. When I need to know how not to teach, I'll give you a
call.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Jan 6 '07 #7

P: n/a

Richard Heathfield <rj*@see.sig.invalidwrote in message
news:hp******************************@bt.com...
Bill Reid said:

<snip>
Let me try to clear it up for you.

Please don't bother. When I need to know how not to teach, I'll give you a
call.
OK. We'll miss you around here, but I can understand your
decision to leave. Again, the question you not only couldn't answer,
but were so confounded by you felt you had to snip it, was:
"Hello,
This is my first application on I/O programming in C. I am
facing problem how to make connection to terminal,
& get words from user keyboard and send words to user screen.
Please help me. Its urgent...."
I guess when you can't even answer a question about the
"C" standard libraries it's time to "sail off into the sunset"...

---
William Ernest Reid

Jan 7 '07 #8

P: n/a
Bill Reid said:

<snip>
Again, the question you not only couldn't answer,
but were so confounded by you felt you had to snip it, was:
It is a mistake to confuse "didn't" with "couldn't".

<snip>

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Jan 7 '07 #9

P: n/a
rup a écrit :
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
If you use the lcc-win32 compiler, you write:

int return_code =
GetHttpUrl("http://www.mysite.com/something.txt","c:\\temp\\downloads");

http://www/cs/virginia.edu/~lcc-win32

This will not work using VC++
Jan 7 '07 #10

P: n/a
jacob navia wrote:
rup a écrit :
>>
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.

If you use the lcc-win32 compiler, you write:

int return_code =
GetHttpUrl("http://www.mysite.com/something.txt","c:\\temp\\downloads");

http://www/cs/virginia.edu/~lcc-win32

This will not work using VC++
And it won't work on anything else either, and thus is OFF-TOPIC on
c.l.c. Why don't you create a sig that redirects queries to
comp.compilers.lcc where it would be topical. Then you might be
able to avoid these persistent irritating off-topic answers.

The only way you could make it topical here would be to publish the
complete code, written in standard C, in your answer.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
Jan 7 '07 #11

This discussion thread is closed

Replies have been disabled for this discussion.