473,543 Members | 2,550 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3212
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.program ming 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.program ming
I've never heard of that group, and I suspect it doesn't exist. You probably
mean comp.os.ms-windows.program mer.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.in validwrote in message
news:HY******** *************@b t.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.in validwrote in message
news:HY******** *************@b t.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.in validwrote in message
news:zK******** *************** *******@bt.com. ..
Bill Reid said:
Richard Heathfield <rj*@see.sig.in validwrote in message
news:HY******** *************@b t.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...teachin g
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...b ut
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.in validwrote 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("htt p://www.mysite.com/something.txt", "c:\\temp\\down loads");

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

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2507
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 bugs, I like to execute the dlls in debug so I can see what is going on. (Some folks in my org seem to have this kinda wacky bias against debugging,...
2
2458
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. Regards, Manish Naik
26
16466
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 Win2K3/IIS6.0), do we still need this patch? 2) Does it specifically solve only this error: The underlying connection was closed. An unexpected error
6
3533
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 every message? Also, the message is complete, meaning there is no more data to read, only when the client closes the connection. My solution is to keep...
3
4059
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 from a .NET Web Application hosted on IIS. In our setup the web request form a client can be running for long duration (may be more than 4 hours). ...
2
2518
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 all the requests I generate. This is the code: public static void Main() { for(int i=0;i<100000;i++)
8
9610
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 work from
0
1372
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. I have found a method calls InternetGetConnectedState() in .net, this returns false or true for connection also this one has flags and you can use...
2
5964
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.... Thanks
0
7399
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7584
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7729
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7677
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5880
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4884
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3385
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
952
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.