int main() { try { SocketClient s("www.site.com", 80); string data = "par1=value1&par2=value2"; s.SendLine("POST /post_page.php HTTP/1.0\r\n"); s.SendLine("Host: www.site.com\r\n"); s.SendLine("User-Agent: Mozilla/4.0\r\n"); s.SendLine("Content-Length: 23\r\n\r\n"); s.SendLine("Content-Type: application/x-www-form-urlencoded\r\n"); s.SendLine("\r\n"); s.SendLine(data + "\r\n"); s.SendLine("\r\n"); while (1) { string l = s.ReceiveLine(); if (l.empty()) break; cout << l; cout.flush(); } } catch (const char* s) { cerr << s << endl; } catch (std::string s) { cerr << s << endl; } catch (...) { cerr << "unhandled exception\n"; } return 0; }