I'm working on an SAP integration where one transaction requires multiple GETs, PATCHes and POSTs. Also there is a requirement to pass etag between the calls. I'm trying $batch but don't know how to pass etag between calls because one modification to the entity changes the etag. This is what I tried.
Content-Type: multipart/mixed;boundary=changeset_01
GET A_OutbDeliveryHeader(DeliveryDocument='0000000001') HTTP/1.1
sap-context-accept: header
Content-Type: application/json
Accept: application/json
Content-ID: C1
--changeset_01
Content-Type: application/http
Content-Transfer-Encoding: binary
PATCH A_OutbDeliveryItem(DeliveryDocument='0000000001',DeliveryDocumentItem='10') HTTP/1.1
sap-context-accept: header
Content-Type: application/json
Accept: application/json
Content-ID: C2
If-Match: xxxxx
{
"ActualDeliveryQuantity": "2.000"
}
--changeset_01
Content-Type: application/http
Content-Transfer-Encoding: binary
PATCH A_OutbDeliveryHeader(DeliveryDocument='0000000001') HTTP/1.1
sap-context-accept: header
Content-Type: application/json
Accept: application/json
Content-ID: C3
If-Match: xxxxx
{
"ActualGoodsMovementDate": "2023-03-14T13:33:10",
"ActualGoodsMovementTime": "PT13H33M10S"
}
GET A_OutbDeliveryHeader(DeliveryDocument='0000000001') HTTP/1.1
sap-context-accept: header
Content-Type: application/json
Accept: application/json
Content-ID: C4
--changeset_01
Content-Type: application/http
Content-Transfer-Encoding: binary
POST PostGoodsIssue?DeliveryDocument='0000000001' HTTP/1.1
sap-context-accept: header
Content-Type: application/json
Accept: application/json
Content-ID: C5
If-Match: xxxxx
--changeset_01--
--batch_01--