2.2.7.6.8 Example Batch Response

The examples below represent a few of the possible responses to the Batch Request shown in Example Batch Request (section 2.2.7.6.5).

Example 1: The following example response assumes all requests except the Retrieve Request in the final query operation succeeded. The Retrieve operation is assumed to have failed because the requested resource did not exist.

The formatting used is the same as that defined in Example Batch Request (section 2.2.7.6.5). Response bodies are excluded in favor of English descriptions inside "<>" brackets to simplify the example.

 HTTP/1.1 202 Accepted
 DataServiceVersion: 1.0
 Content-Length: ####
 Content-Type: multipart/mixed; boundary=batch(36522ad7-fc75-4b56-8c71-56071383e77b)
  
  
 --batch(36522ad7-fc75-4b56-8c71-56071383e77b)
 Content-Type: application/http
 Content-Transfer-Encoding: binary
  
 HTTP/1.1 200 Ok
 Content-Type: application/atom+xml;type=entry
 Content-Length: ###
  
 <AtomPub representation of the Customer entity with EntityKey ALFKI>
  
 --batch(36522ad7-fc75-4b56-8c71-56071383e77b)
 Content-Type: multipart/mixed; boundary=changeset(77162fcd-b8da-41ac-a9f8-9357efbbd621)
 Content-Length: ###      
  
 --changeset(77162fcd-b8da-41ac-a9f8-9357efbbd621)
 Content-Type: application/http
 Content-Transfer-Encoding: binary
 Content-ID: 1
  
 HTTP/1.1 201 Created
 Content-Type: application/atom+xml;type=entry
 Location: http://host/service.svc/Customer('POIUY')
 Content-Length: ###
  
 <AtomPub representation of a new Customer entity>
  
 --changeset(77162fcd-b8da-41ac-a9f8-9357efbbd621)
 Content-Type: application/http
 Content-Transfer-Encoding: binary
 Content-ID: 2
  
 HTTP/1.1 201 Created
 Content-Type: application/atom+xml;type=entry
 Location: http://host/service.svc/Orders(200)
 Content-Length: ###
  
 <AtomPub representation of a new Order entity>
  
 --changeset(77162fcd-b8da-41ac-a9f8-9357efbbd621)
 Content-Type: application/http
 Content-Transfer-Encoding: binary
 Content-ID: 3
  
 HTTP/1.1 204 No Content
 Host: host
  
  
 --changeset(77162fcd-b8da-41ac-a9f8-9357efbbd621)--
  
  
 --batch(36522ad7-fc75-4b56-8c71-56071383e77b)
 Content-Type: application/http
 Content-Transfer-Encoding: binary
  
 HTTP/1.1 404 Not Found
 Content-Type: application/xml
 Content-Length: ###
  
 <Error message>
  
 --batch(36522ad7-fc75-4b56-8c71-56071383e77b)--

Example 2: The example response below assumes that at least one of the requests in the change set failed due to a failed data service specific authorization check, and that the Retrieve Request in the final query operation failed because the requested resource did not exist. All other requests are assumed to have succeeded.

The formatting used is the same as that defined in Example Batch Request (section 2.2.7.6.5). Response bodies are excluded in favor of English descriptions inside "<>" brackets to simplify the example.

 HTTP/1.1 202 Accepted
 DataServiceVersion: 1.0
 Content-Length: ####
 Content-Type: multipart/mixed
               ; boundary=batch(36522ad7-fc75-4b56-8c71-56071383e77b)
  
 --batch(36522ad7-fc75-4b56-8c71-56071383e77b)
 Content-Type: application/http
 Content-Transfer-Encoding: binary
  
 HTTP/1.1 200 Ok
 Content-Type: application/atom+xml;type=entry
 Content-Length: ###
  
 <AtomPub representation of the Customer entity with EntityKey ALFKI>
 --batch(36522ad7-fc75-4b56-8c71-56071383e77b)
 Content-Type: application/http
 Content-Transfer-Encoding: binary
  
 HTTP/1.1 403 Forbidden
 Content-Type: application/xml
 Content-Length: ###
  
 <Error message>
 --batch(36522ad7-fc75-4b56-8c71-56071383e77b)
 Content-Type: application/http
 Content-Transfer-Encoding: binary
  
 HTTP/1.1 404 Not Found
 Content-Type: application/xml
 Content-Length: ###
  
 <Error message>
 --batch(36522ad7-fc75-4b56-8c71-56071383e77b)—