2.2.7.4.2 DeleteLink Request

The purpose of the DeleteLink request is to enable an existing link between two EntityType instances to be removed. AtomPub [RFC5023] does not define a request of this type. Therefore, this request type is not based on an AtomPub-defined [RFC5023] request.

A DeleteLink request MUST use the HTTP DELETE method and the URI specified by the client in the HTTP request line MUST be a valid data service URI that identifies a single link between two EntityType instances, as specified in URI Format: Resource Addressing Rules (section 2.2.3). For example, using Appendix A: Sample Entity Data Model and CSDL Document (section 6), the following are valid URIs for requests of this type: http://host/service.svc/Customers('ALFKI')/$links/Orders(1) and http://host/service.svc/Orders(1)/$links/Customer.

DeleteLink request MUST contain 0 bytes in the payload. If a DeleteLink request is successful, the response MUST have a 204 status code, as specified in [RFC2616], and an empty response body.

If the DeleteLink request is not successful (for example, an error occurred while processing the request), the response MUST be formatted according to Error Response (section 2.2.8.1).

The syntax of a DeleteLink request is defined as follows:

 deleteLink-Req          =   deleteLink-ReqLine  
                             deleteLink-ReqHeaders 
                             CRLF
                            
 deleteLink-ReqLine      =   "DELETE"   
                             SP entityTypeInstanceSingleLinkUri deleteLink-QueryOps  
                             SP HTTP-Version  
                             CRLF
  
 deleteLink-ReqHeaders   =   [DataServiceVersion]        
                             ; see section 2.2.5.3   
                             [MaxDataServiceVersion]     
                             ; see section 2.2.5.7   
                             *(HTTP-Header-Types)    
  
 entityTypeInstanceSingleLinkUri = <Any Resource Path identifying a single link>
                                    ; see section 2.2.3 and section 2.2.3.5 -- URI7
  
 deleteLink-QueryOps     = ["?" customQueryOption *("&" customQueryOption)] 
                             ; see section 2.2.3.1 

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

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