MSDN Documentation

Microsoft Developer Network

Win32 Internet Functions

The Win32 Internet Functions provide a comprehensive set of APIs for developing internet-aware applications on Windows. These functions allow your applications to access internet resources using protocols like HTTP, FTP, and Gopher.

This documentation provides detailed information on the Win32 Internet Functions, including their purpose, usage, parameters, return values, and related concepts. Whether you are building a web browser, an FTP client, or integrating internet capabilities into your existing application, you'll find the necessary resources here.

Core Concepts

Understanding the fundamental concepts is crucial for effectively using the Win32 Internet Functions:

  • Internet Sessions: Represents a client's connection to the internet. You typically establish an internet session before making any requests.
  • Internet Handles: These are opaque identifiers used to represent various internet resources, such as sessions, connections, and requests.
  • Protocols: The Win32 Internet Functions support various protocols, including:
    • HTTP (Hypertext Transfer Protocol): For retrieving web pages and other web resources.
    • FTP (File Transfer Protocol): For transferring files between a client and a server.
    • Gopher: An older protocol for browsing distributed document servers.
    • HTTPS (HTTP Secure): For secure communication over the internet using SSL/TLS.
  • Asynchronous Operations: Many internet operations can be performed asynchronously to prevent the application from blocking while waiting for network responses.

Key Functions

Here are some of the most commonly used Win32 Internet Functions:

  • InternetOpen(): Initializes an application's use of the Win32 Internet Functions and identifies the calling application to the internet.
  • InternetConnect(): Establishes a new connection to an internet server.
  • HttpOpenRequest(): Creates an HTTP request handle.
  • HttpSendRequest(): Sends the request to the HTTP server.
  • InternetReadFile(): Reads data from an internet resource.
  • InternetCloseHandle(): Closes an internet handle and frees associated resources.
  • FtpOpenFile(): Opens a file on an FTP server.
  • GopherFindFirstFile(): Finds the first file or directory on a Gopher server.

Tutorials and Samples

Explore the following resources to get hands-on experience with the Win32 Internet Functions:

API Reference

For a complete reference of all Win32 Internet Functions, their parameters, and return values, please refer to the detailed API documentation:

Function Name Description Link
InternetOpen Initializes internet session. Details
InternetConnect Establishes a connection. Details
HttpOpenRequest Creates an HTTP request. Details
InternetReadFile Reads data. Details