Http

This is a discussion on Http within the Networking/Device Communication forums, part of the General Programming Boards category; Anyone has any open-source API that uses HTTP? or any good tutorial about how using HTTP API in the Win32?...

  1. #1
    Registered User
    Join Date
    Oct 2005
    Location
    Brasil
    Posts
    220

    Http

    Anyone has any open-source API that uses HTTP? or any good tutorial about how using HTTP API in the Win32?

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,175
    Check out libcurl.
    If you understand what you're doing, you're not learning anything.

  3. #3
    Registered User
    Join Date
    Oct 2005
    Location
    Brasil
    Posts
    220
    I would like a HTTP API only

  4. #4
    Registered User
    Join Date
    Oct 2005
    Location
    Brasil
    Posts
    220
    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() ?

  5. #5
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,175
    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.

  6. #6
    Registered User
    Join Date
    Oct 2005
    Location
    Brasil
    Posts
    220
    ok, so for example, if i wanted to access this board, i would put gethostbyname("cboard.programming.com") ?

  7. #7
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,175
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. HTTP Methods POST AND GET "DATA"
    By bhupesh.kec in forum C Programming
    Replies: 4
    Last Post: 06-05-2008, 01:35 PM
  2. Error stop Http Listener
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 06-04-2008, 03:14 AM
  3. my HTTP request handler code correct?
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 04-25-2008, 05:01 AM
  4. C# HTTP request/response
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 04-02-2008, 07:00 AM
  5. Writing all HTTP requests from a website to a log file
    By goomyman in forum C# Programming
    Replies: 1
    Last Post: 07-29-2005, 10:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21