473,395 Members | 1,937 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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
10 3197
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
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

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
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

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
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

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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Stephanie | last post by:
I have a problem that I am trying to solve. We have a huge product with a whole lot of ASP and VB code. VB code is all ActiveX dlls which are used by ASP app. When I attempt to add features or fix...
2
by: Manish Naik | last post by:
Hi, Using ASP.Net, I want to store and retrive documents (Word, excel, etc) from SQL Server 2000 database. I have tried image type data field, but could not succed. Can any one help me please. ...
26
by: Rajeev Tipnis | last post by:
http://support.microsoft.com/default.aspx?scid=kb;en- us;819450 Questions: 1) Is this patch (fix) applicable to the .NET 1.1 Framework as well? That is, if we have Framework 1.1 (On...
6
by: Sharon | last post by:
Hi all. I'm trying first time async socket connection. In all the examples i've seen, the server connection is closed when the message is complete. Is it common to close the connection after...
3
by: Rahul Anand | last post by:
As per our requirements we have a web service which internally connects (Simple HTTP Post Request) to a remote server to initiate some work. We are calling the web service method asynchronously...
2
by: Basel | last post by:
Hi All! My code issues Http POST requests in a loop using HttpWebRequest, I set one unique ConnectionGroupName, and I expected from the client to open one underlying persistent connection for...
8
by: Greg Strong | last post by:
Hello All, The short questions are 1 Do you know how to make DSN connection close in Access to Oracle 10g Express Edition? &/or 2 Do you know how to make a DSN-less pass-through query...
0
by: Arthur | last post by:
Hi, I am trying to write a windows service in VC++.NET 2003, the task of this server is to detect the kind of internet connection and if there is a connection send some file and do something. ...
2
by: rup | last post by:
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.......
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.