Example 45: a batch request that contains the following individual requests in the order listed A query request An atomicity group that contains the following requests: Insert entity Update entity A second query request Note: For brevity, in the example, request bodies are excluded in of English descriptions inside <> brackets and OData-Version headers are omitted. POST /service/$batch HTTP/1.1 Host: host OData-Version: 4.01 Content-Type: application/json Content-Length: ### { "requests": [ { "id": "0", "method": "get", "url": "/service/Customers('ALFKI')" }, { "id": "1", "atomicityGroup": "group1", "dependsOn": ["0" ], "method": "patch", "url": "/service/Customers('ALFKI')", "headers": { "Prefer": "return=minimal" }, "body": <JSON representation of changes to Customer ALFKI> }, { "id": "2", "atomicityGroup": "group1", "method": "post", "url": "/service/Customers", "body": <JSON representation of a new Customer entity> }, { "id": "3", "dependsOn": [ "group1" ], "method": "get", "url": "/service/Products" } ] }
Example 45: a batch request that contains the following individual requests in the order listed A query request An atomicity group that contains the following requests: Insert entity Update entity A second query request Note: For brevity, in the example, request bodies are excluded in of English descriptions inside <> brackets and OData-Version headers are omitted. POST /service/$batch HTTP/1.1 Host: host OData-Version: 4.01 Content-Type: application/json Content-Length: ### { "requests": [ { "id": "0", "method": "get", "url": "/service/Customers('ALFKI')" }, { "id": "1", "atomicityGroup": "group1", "dependsOn": ["0" ], "method": "patch", "url": "/service/Customers('ALFKI')", "headers": { "Prefer": "return=minimal" }, "body": <JSON representation of changes to Customer ALFKI> }, { "id": "2", "atomicityGroup": "group1", "method": "post", "url": "/service/Customers", "body": <JSON representation of a new Customer entity> }, { "id": "3", "dependsOn": [ "group1" ], "method": "get", "url": "/service/Products" } ] }
odata-json-format-v4.01-wd05-2017-12-19.docx