Cancel-Session
Use the Cancel-Session packet to terminate the upload session with the BITS server.
BITS_POST remote-URL HTTP/1.1
BITS-Packet-Type: Cancel-Session
BITS-Session-Id: {guid}
Headers
-
BITS_POST
-
BITS-specific verb that identifies this packet to the BITS server.
Replace remote-URL with the absolute or relative URI. Typically, replace remote-URL with the remote file name of the job. For network load balancing considerations, see the BITS-Host-Id header in the Create-Session packet.
-
BITS-Packet-Type
-
Identifies this request packet as a Cancel-Session packet.
-
BITS-Session-Id
-
String GUID that identifies the session to the server. Replace {guid} with the session identifier that the server returns in the Ack for Create-Session response packet.
Remarks
This packet cancels an upload job if it is sent before the last fragment is sent. Cancel-Session has no effect on a file whose last fragment has already been sent. When the BITS server receives the last fragment, it writes the file to its final destination and, in the case of an upload-reply, posts the file to the server application. In the upload-reply case, the Cancel-Session packet cancels the reply portion of an upload-reply job.
The BITS server releases all resources and deletes all temporary files when it receives this packet.
The BITS client sends this packet when the user cancels the job.
See also