Generally, batch requests are supported in the Odata service, the excel add-ins in Dynamics 365 for finance and operations use Odata batch to communicate in a single request but how can we leverage it in Postman.
Using Excel add-in then add records and submit to Dynamics 365 for finance and operations, see how the odata batch framework works. This can be done from POSTMAN too and you need to use header and body.
2. Create a new POST request in Postman with header
URL: {{resource}}/data/$batch
Content-Type: multipart/mixed;boundary=batch_d63a-e9be-2927
--batch_d63a-e9be-2927
Content-Type: application/http
Content-Transfer-Encoding:binary
GET TestDatas?$filter=StudentID eq '123' HTTP/1.1
--batch_d63a-e9be-2927
Content-Type: multipart/mixed; boundary=changeset_2499-90ab-7b93
--changeset_2499-90ab-7b93
Content-Type: application/http
Content-Transfer-Encoding: binary
POST TestDatas HTTP/1.1
Content-ID: 1
Accept: application/json;q=0.9, */*;q=0.1
OData-Version: 4.0
Content-Type: application/json
OData-MaxVersion: 4.0
{"dataAreaId": "dat","StudentID": "144","StudentName": "John"}
--changeset_2499-90ab-7b93
Content-Type: application/http
Content-Transfer-Encoding: binary
Content-ID: 2
PATCH TestDatas(dataAreaId='dat',StudentID='123') HTTP/1.1
Content-Type: application/json
Prefer: return=minimal
{
"StudentName": "Oliver"
}
--changeset_2499-90ab-7b93--
--batch_d63a-e9be-2927--
HEY HEY HEY !!!! HACK OF THE DAY!!!!!
in batch request all changeset numbers will be executed in one loop. if you want to process multi-POST request add in same changeset number.
Comments
Post a Comment