Freigeben über


2.2.7.4.1 DeleteEntity Request

The purpose of the DeleteEntity request is to enable an EntityType instance to be deleted from a data service. The base rules and semantics of this request type are defined by AtomPub, as specified in [RFC5023] section 9.4 -- Deleting Resources with DELETE. As described in Abstract Data Model (section 2.2.1), Entity Data Model constructs are mapped directly to data model concepts used in AtomPub. For example, EntityTypes are AtomPub Entry Resources and EntitySets are AtomPub collections. This section adds constraints to those defined in AtomPub for this request type.

As in [RFC5023] section 9.4, DeleteEntity requests MUST use the HTTP DELETE method, and the URI specified by the client in the HTTP request line addresses an AtomPub Member Resource. Because an Entry Resource (subtype of Member Resource) maps to an EntityType instance in an Entity Data Model, the HTTP request line URI MUST be any valid data service URI which identifies a single EntityType instance, as specified in URI Format: Resource Addressing Rules (section 2.2.3).

A DeleteEntity request MAY<66> cause additional side effects (for example, cascading deletes) to the entities in a data service.

If a DeleteEntity request is sent to a URI that identifies an entity that represents a Media Link Entry, then as part of deleting the entity, the associated Media Resource SHOULD also be deleted.

A DeleteEntity request MUST have an empty (0 bytes) payload. If the DeleteEntity request was successful, the response MUST have a 204 (No Content) status code, as specified in [RFC2616]. If the DeleteEntity request is not successful, the response MUST be formatted according to Error Response (section 2.2.8.1).

The syntax of a DeleteEntity request is defined as follows:

 deleteEntity-Req         = deleteEntity-ReqLine
                            deleteEntity-ReqHeaders
                            CRLF
  
 deleteEntity-ReqLine     = "DELETE"
                             SP entityTypeInstanceUri deleteEntity-QueryOps
                             SP HTTP-Version CRLF
  
 deleteEntity-ReqHeaders  = [DataServiceVersion]        ; see section 2.2.5.3
                            [MaxDataServiceVersion]     ; see section 2.2.5.7
                            [If-Match]                  ; see section 2.2.5.5
                            *(HTTP-Header-Types)
  
 entityTypeInstanceUri    = <Any Resource Path identifying an Entity Type instance>
                            ; see section 2.2.3 and section 2.2.3.5 -- URI2 & URI6
  
 deleteEntity-QueryOps    = ["?" customQueryOption *("&" customQueryOption)]
                            ; see section 2.2.3.1

The syntax of a response to a successful DeleteEntity request is defined as follows:

 deleteEntity-Resp        = Status-Line    ; see [RFC2616] section 6.1.1
                            deleteEntity-RespHeaders
                            CRLF
  
 deleteEntity-RespHeaders  = DataServiceVersion             ; see section 2.2.5.3
                            *(HTTP-Header-Types)