Guilherme Maeda
Guilherme Maeda

Reputation: 158

OData $batch request using ODataQueryBuilder or VDM

Is there a way to send OData batch requests using either ODataQueryBuilder or VDM generated classes?

Example:

Let's say I'm using the Northwind public OData service (https://services.odata.org/V2/Northwind/Northwind.svc/)

Due to network performance I want to query the Customers, Categories and Regions in one only request, like this:

URL: https://services.odata.org/V2/Northwind/Northwind.svc/$batch

--batch_8008-578f-c3c1
Content-Type: application/http
Content-Transfer-Encoding: binary

GET Customers HTTP/1.1
Accept: application/json
Accept-Language: en
DataServiceVersion: 2.0
MaxDataServiceVersion: 2.0


--batch_8008-578f-c3c1
Content-Type: application/http
Content-Transfer-Encoding: binary

GET Categories HTTP/1.1
Accept: application/json
Accept-Language: en
DataServiceVersion: 2.0
MaxDataServiceVersion: 2.0


--batch_8008-578f-c3c1
Content-Type: application/http
Content-Transfer-Encoding: binary

GET Regions HTTP/1.1
Accept: application/json
Accept-Language: en
DataServiceVersion: 2.0
MaxDataServiceVersion: 2.0


--batch_8008-578f-c3c1--

(I tested this in Postman, it works.)

I have other scenarios where this would be really useful, such as reading several individual entries at once, sending ChangeSets to change several entries in a "transaction", and calling function imports.

Upvotes: 3

Views: 209

Answers (1)

Philipp Herzig
Philipp Herzig

Reputation: 360

This feature is not yet supported but, of course, completely valid. We will update this question once an update regarding this matter is available.

Upvotes: 1

Related Questions