Load web page

How can I load a webpage using C (not with libcurl), OS: Win32

+1


source to share


3 answers


To load a web page, you need two things:

  • Establish a communication channel with websever
  • Control the web server protocol to load the page.


For the first item, take a look at the socket API. You need to open a socket, send some data with send (), get data from the web server.

For the second item, you need to understand the http protocol.

+4


source


Try wininet API



+3


source


What you need to do is called "socket communication". For a great overview, check

http://web.archive.org/web/20090227031327/http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_15.html

http://web.archive.org/web/20090402133256/http://www.uwo.ca/its/doc/courses/notes/socket/

http://wiki.linuxquestions.org/wiki/Connecting_a_socket_in_C

This last link is from linuxquestions, but both solutions are completely cross platform, unlike frankodwyer's suggestion from wininet. The last link also does exactly what you want as it loads the web page.

+1


source







All Articles