大网数据广告活动
网络与域名解析

Ack for Create-Session

· 52CE 我爱测

Use the Ack for Create-Session packet to acknowledge the client's Create-Session request.

Use the Ack for Create-Session packet to acknowledge the client's Create-Session request.

reason-code reason-description
BITS-Packet-Type: Ack
BITS-Protocol: {guid}
BITS-Session-Id: {guid}
BITS-Host-Id: PublicHostName
BITS-Host-Id-Fallback-Timeout: Timeout
Accept-Encoding: Identity
Content-Length: length
BITS-Error-Code: error-code
BITS-Error-Context: error-context

Headers

reason-code

Replace reason-code with the HTTP reason code. The following table shows the typical reason codes for a response to a Create-Session request. For a list of HTTP reason codes, see RFC 2616.

Reason code Description
200 OK. The request was successful.
201 Created. The session was created.
403 Forbidden. The user is not allowed to upload files to the specified URL.
404 Not Found. The specified URL does not exist.
409 Conflict. The file exists on the server and cannot be overwritten.

reason-description

Replace reason-description with the HTTP description associated with the reason code. For example, set reason-description to OK if reason-code is 200.

BITS-Packet-Type

Identifies this response packet as an Ack packet.

BITS-Protocol

String GUID that identifies the protocol that the server wants to use for this session. Replace {guid} with the protocol identifier from the list of protocols the client includes in the Create-Session request; the BITS-Supported-Protocol header contains the list. Include this header only if the reason-code is 200 or 201.

BITS-Session-Id

String GUID that identifies this session to the client. Replace {guid} with the session identifier that the client sends in all subsequent request packets.

BITS uses a GUID to identify the session, but you can use any HTTP-legal string up to 100 characters.

BITS-Host-Id

Optional. Include this header only if the BITS IIS extension property, BITSHostId, is set. Replace PublicHostName with the server name or IP address from the BITSHostId property.

The client must replace the server portion of the remote-URL on all subsequent packets. If the client does not specify this host name on subsequent packets, it is possible that the job will begin again on another server in the farm, leaving a partial upload file on the previous server.

BITS-Host-Id-Fallback-Timeout

Optional. Include this header only if the BITS-Host-Id header is specified. Replace Timeout with the time-out value from the BITSHostIdFallbackTimeout property. The BITSHostIdFallbackTimeout property is one of the BITS IIS extension properties.

The client uses the time-out period to determine how long it tries to reconnect to the server name specified in the BITS-Host-Id header before reverting to the host name specified in the remote file name of the job. The timer begins when BITS is unable to connect to the BITS-Host-Id server. The timer is reset when a connection to the server is restored. If a time-out period is not specified, the client never reverts to the host name specified in the remote file name.

Accept-Encoding

Identifies the encoding scheme to use on the fragments sent to the server. The Fragment packet contains the encoded fragment in the body of the packet. The BITS server requires Identity encoding (plaintext). Include this header only if the Reason-code is 200 or 201.

Content-Length

Replace length with the number of bytes included in the body of the response. Required even if the body of the response does not include content.

BITS-Error-Code

Replace error-code with a hexadecimal number that represents an HRESULT value associated with a server-side error. Include this header only if reason-code is not 200 or 201.

BITS-Error-Context

Replace error-context with a hexadecimal number that represents the context in which the error occurred. Specify the hexadecimal number for BG_ERROR_CONTEXT_REMOTE_FILE (0x5) if the server generated the error. Otherwise, specify the hexadecimal number for BG_ERROR_CONTEXT_REMOTE_APPLICATION (0x7) if the error was generated by the application to which the upload file is passed. Include this header only if the reason-code is not 200 or 201.

See also

Create-Session

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)

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

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