大网数据广告活动
Web服务器与PHP

Versioning (HTTP Server API)

· 52CE 我爱测

The HTTP Server version 2.0 API applies object-scoped versioning to determine the version of the API.

The HTTP Server version 2.0 API makes obsolete the version 1.0 request queues and URL associations with the request queue. Object-scoped versioning allows applications to supply application-specific version information. An applications can automatically call the correct version of structures for the operating system on which it is running.

Request Queues

Starting with HTTP Server version 2.0 API, request queues are created with HttpCreateRequestQueue making obsolete the version 1.0 HttpCreateHttpHandle function. URL groups are introduced in version 2.0 with the HttpCreateUrlGroup function. URLs are added to the group using HttpAddUrlToUrlGroup which makes obsolete the version 1.0 HttpAddUrl function. Version 2.0 URL groups must not be used with version 1.0 request queues.

Starting with version 2.0, the following version 1.0 functions are obsolete and cannot be used with version 2.0 request queues:

For more information about configuring URL groups, see the Configuring the URL Group topic. For more information about version 2.0 request queues, see the Named Request Queue topic.

Object-Scoped Versioning

In version 1.0, the application supplies the HTTP Server API version in the call to HttpInitialize. The version information is accepted only from the first application that called HttpInitialize and is applied to all the HTTP Server API applications in the same process. Starting with the version 2.0 API, the global version information supplied in the call to HttpInitialize is not used. For version 2.0 applications, the HTTP Server API version is passed in the Version parameter when the request queue or server session is created by HttpCreateRequestQueue or HttpCreateServerSession. When the request queue is created with the version 1.0 HttpCreateHttpHandle, it is automatically marked as version 1.0. Both version 1.0 and version 2.0 applications can run in the same process.

The HTTP_REQUEST and HTTP_RESPONSE structures are updated to include authentication information in the HTTP Server version 2.0 API. HTTP_REQUEST_V1 and HTTP_REQUEST_V2 are specific to the version of the API used by the application. However, applications should not use these structures directly in their code; instead they should use HTTP_REQUEST to get the correct version based on the version of the request queue on which the request was received. Also, be aware that size of the HTTP_REQUEST structure is based on the version of the operating system under which the code is compiled.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。