This is an old revision of the document!
To get from or post data to a web server you can easily use standard sockets.
if ((s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) exit(1); if (connect(s, "checkip.dyndns.com", 80) < 0) exit(2); if (send(s, "GET / HTTP/1.0\r\n\r\n") == -1) exit(3); if ((r = recv(s)) == NULL) exit(4); printf("%s\n", r); if (!strstr(r, "HTTP/1.1 200 OK")) { i = substr(r, strstr(r, "IP Address: ") + 12, strlen(r)); printf("IP Address: %s\n", left(i, strstr(i, "</body>"))); } close(s); exit(0);
HTTP/1.1 200 OK Content-Type: text/html Server: DynDNS-CheckIP/1.0 Connection: close Cache-Control: no-cache Pragma: no-cache Content-Length: 102 <html><head><title>Current IP Check</title></head><body>Current IP Address: 89.12.4.18</body></html> IP Address: 89.12.4.18