2.2.1.2 HTTP Header Fields Introduced by the BITS Upload Protocol

BITS-Packet-Type: This represents the type of the message being sent from client to server or server to client. This is a string of characters and MUST be one of the following: CREATE-SESSION, PING, FRAGMENT, CLOSE-SESSION, CANCEL-SESSION, or Ack. This field MUST be present for all the request and response messages defined in section 2.2 except sections 2.2.12 and 2.2.13.

BITS-Session-Id: A GUID (as specified in [MS-DTYP] section 2.3.4.3), which MUST be unique among all sessions on a particular server, that identifies the BITS session for the given request entity. This field MUST be present in all request messages except CREATE-SESSION. The field MUST be present in response messages with an HTTP status of 200. It MAY be present in other response messages; if present, its value MUST be the same as in the corresponding request message.

BITS-Error: An HRESULT value that represents the error returned from the BITS server. This header SHOULD be included only if the HTTP status code is not 200.<4>

BITS-Error-Context: This specifies the context in which the error was generated. This MUST be CONTEXT_SERVER (0x5) if the error was encountered during the message processing on the server or CONTEXT_REMOTE_APPLICATION (0x7) if the error was returned from the server application. This header MUST be included only if BITS-Error is present.

The errors that could be returned from the server to the client are described in the following table.

HRESULT

HTTP status code

Description

BG_E_SESSION_NOT_FOUND (x8020001F)

500

BITS session–related information is not found on the server.

E_ACCESSDENIED (x80070005)

403

It can be one of the following:

The destination URL exists on the server and cannot be overwritten.

The client is not authorized to access the URL on the server.

E_ACCESSDENIED (x80070005)

501

Uploads are not enabled for the virtual directory.

0

416

The client and server are out of sync, and the server cannot proceed further with the FRAGMENT message processing. The client can read the correct offset from the Ack and send another FRAGMENT.

E_INVALIDARG (0x80070057)

400

The client's request was invalid in some way, including:

  • The Content-Range format was invalid or the range information sent from the client is incorrect.

  • The size of the header field value sent from the client is greater than 4 kilobytes.

  • None of the GUIDs (as specified in [MS-DTYP] section 2.3.4.3) sent by the client as part of the BITS-Supported-Protocols header can be recognized by the server.

  • The client sends a different request entity length as part of the Content-Range header in subsequent fragments.

  • The destination URL maps to a directory instead.

  •  The Content-Length header is not sent from the client.

  • An Unknown BITS-Packet-Type value was received by the server.

  • The size of the reply URL received by the server from the server application is greater than 2,200 characters.

BG_E_TOO_LARGE (x80200020)

500

The fragment size sent by the client cannot be handled by the server.

ERROR_DISK_FULL (x80070112)

500

The server is out of disk space.