Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 2.24 KB

steps-in-a-typical-http-client-application.md

File metadata and controls

26 lines (22 loc) · 2.24 KB
description title ms.date helpviewer_keywords ms.assetid
Learn more about: Steps in a Typical HTTP Client Application
Steps in a Typical HTTP Client Application
11/04/2016
HTTP client applications [MFC]
client applications [MFC], HTTP
Internet applications [MFC], HTTP client applications
applications [MFC], HTTP client
Internet client applications [MFC], HTTP table
WinInet classes [MFC], HTTP
f86552e8-8acd-4b23-bdc5-0c3a247ebd74

Steps in a Typical HTTP Client Application

The following table shows the steps you might perform in a typical HTTP client application:

Your goal Actions you take Effects
Begin an HTTP session. Create a CInternetSession object. Initializes WinInet and connects to server.
Connect to an HTTP server. Use CInternetSession::GetHttpConnection. Returns a CHttpConnection object.
Open an HTTP request. Use CHttpConnection::OpenRequest. Returns a CHttpFile object.
Send an HTTP request. Use CHttpFile::AddRequestHeaders and CHttpFile::SendRequest. Finds the file. Returns FALSE if the file is not found.
Read from the file. Use CHttpFile. Reads the specified number of bytes using a buffer you supply.
Handle exceptions. Use the CInternetException class. Handles all common Internet exception types.
End the HTTP session. Dispose of the CInternetSession object. Automatically cleans up open file handles and connections.

See also

Win32 Internet Extensions (WinInet)
Prerequisites for Internet Client Classes
Writing an Internet Client Application Using MFC WinInet Classes