It sounds like to me that you want to implement the HTTP protocol from scratch on top of the POSIX sockets API. I have done this myself, it was quite fun.
Read about the sockets API here: http://en.wikipedia.org/wiki/Berkeley_sockets
If you want to work on Windows, see here.
This link, posted in the comments, provides a pretty good starting-point example for using the API, although it weirdly includes both the client and the server as serial logic within the same program -- which may allow it to bypass some of the calls (such as waiting for incoming connections) required to implement a client or server as a standalone program.
Assuming you are implementing an HTTP server in C++, you might choose to implement the client as a web page (running on your favorite browser), as the following hack demonstrates...
<html>
<head>
</head>
<body>
This web page sends the entered text back to the server upon a button press.
The server's response is then displayed in the box below.
This is only a hack for learning purposes, and not a demonstration of best-practices.
<br>
<textarea id="INP">
Hello world!
</textarea>
<br>
<button onclick="return make_request('INP','GET','test1')">GET Request</button>
<button onclick="return make_request('INP','POST','test2')">POST Request</button>
<div id="result" style='border-style:solid;'>?</div>
<script>
function make_request( textID, request_type, webfn )
{
var url = "" + "?webfn="+webfn // assumes this page was served by the same server
if ( request_type != 'POST' ) url += "&value="+document.getElementById(textID).value;
var req = new XMLHttpRequest();
req.open( request_type, url, /*async*/false );
req.send( request_type=='POST' ? document.getElementById(textID).value : null );
if ( req.readyState == 4/*complete*/ && req.status == 200/*OK*/ )
{
result = req.responseXML.documentElement.getElementsByTagName('value')[0].firstChild.data;
document.getElementById('result').innerHTML = req.responseText;
}
else alert("HTTP request failed");
return false;
}
</script>
</body>
</html>