您的位置:首页 > 理论基础 > 计算机网络

建立典型HTTP Client应用程序的步骤

2009-02-19 16:55 204 查看
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.

From: http://www.cppblog.com/gohan/archive/2008/06/19/53963.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: