다음을 통해 공유


일반적인 HTTP 클라이언트 응용 프로그램의 단계

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

Your goal

Actions you take

효과

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.

예외 처리

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.

참고 항목

개념

Win32 인터넷 확장(WinInet)

인터넷 클라이언트 클래스의 필수 구성 요소

MFC WinInet 클래스를 사용하여 인터넷 클라이언트 응용 프로그램 작성