Document libraries are represented as EntityTypes that have an associated media resource, as specified in [RFC5023].

Inserting new documents to a document library involve sending a POST request containing the contents of the document to the EntitySet representing the document library. The protocol client MUST include the SLUG header (as specified in [RFC5023] section 9.7) whose value is the name of the file that is being created in their POST requests. The client can include the content type identifier of the document. If the content type identifier is omitted, the document will be assigned the default content type identifier of the document library. The Augmented BNF for SLUG header construction when inserting new documents is as follows:

slug     = path [ "|" contenttype ]
path     = serverpath                 
serverpath     = *pchar                ; section 3.3 of [RFC3986]
         ; server-relative path of document
filename     = *pchar                ; section 3.3 of [RFC3986]
        ; desired name of the document including its extension
contenttype     = *pchar                ; section 3.3 of [RFC3986]
         ; content type identifier of the document

Using the preceding Augmented BNF causes a document to be created on the protocol server. For more details, see [MS-ODATA] section 3.2.5.