Anyone has any open-source API that uses HTTP? or any good tutorial about how using HTTP API in the Win32?
Anyone has any open-source API that uses HTTP? or any good tutorial about how using HTTP API in the Win32?
Check out libcurl.
If you understand what you're doing, you're not learning anything.
I would like a HTTP API only
Ok, im trying to get a file from a HTTP server, im using winsocks, is there a way to correctly parse a string "http://www.microsoft.com" or i just put it on gethostbyname() ?
gethostbyname() doesn't understand URL syntax. You would need to pass it www.microsoft.com without the "http://".
If you understand what you're doing, you're not learning anything.
ok, so for example, if i wanted to access this board, i would put gethostbyname("cboard.programming.com") ?
Yes. The man page for gethostbyname() is pretty clear:
struct hostent *gethostbyname(const char *name);
The gethostbyname() function returns a structure of type hostent for the given host name. Here name is either a host name, or an IPv4 address in standard dot notation, or an IPv6 address in colon (and possibly dot) notation. (See RFC 1884 for the description of IPv6 addresses.) If name is an IPv4 or IPv6 address, no lookup is performed and gethostbyname() simply copies name into the h_name field and its struct in_addr equivalent into the h_addr_list[0] field of the returned hostent structure. If name doesn't end in a dot and the environment variable HOSTALIASES is set, the alias file pointed to by HOSTALIASES will first be searched for name (see hostname(7) for the file format). The current domain and its parents are searched unless name ends in a dot.
If you understand what you're doing, you're not learning anything.