Close-Session

Use the Close-Session packet to tell the BITS server that file upload is complete and to end the session.

BITS_POST remote-URL HTTP/1.1
BITS-Packet-Type: Close-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 Close-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

The BITS server releases all resources and deletes all temporary files when it receives this packet.

For upload-reply jobs, you must download the reply before sending Close-Session. Otherwise, the reply is lost.

If you send this packet before uploading all fragments, the upload file is deleted; you cannot upload a partial file.

See also

Ack for Close-Session

Cancel-Session

Create-Session