Options
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
‎20-06-2024
11:27
by
Gert-Jan van der Kamp
(Updated
‎20-06-2024
11:30
by
Gert-Jan van der Kamp )
Hi all,
Right now the ETag header is only returned for GET requests, but (the latest) is required for PATCH and POST. When I need to update an order that leads to the following flow:
- GET /api/v3/SalesOrders/${OrderType}/${OrderId} // get whole order just for etag header
- PATCH /api/v3/SalesOrders/${OrderType}/${OrderId} // use etag to update Order
- GET /api/v3/SalesOrders/${OrderType}/${OrderId} // get etag header again
- DELETE /api/v3/SalesOrders/${OrderType}/${OrderId} /lines?lineIds=1,2,3,4,5 // use etag to delete lines
- GET /api/v3/SalesOrders/${OrderType}/${OrderId} // get etag header again
- POST /api/v3/SalesOrders/${OrderType}/${OrderId} /lines // use etag to insert lines
Doing a full get is a bit wasteful and introduces added calls/latency.
Could you guys include the ETag header in the reply for POST, PATCH and DELETE? Ideally also include a HEAD to get it without getting the full Order.
That could shorten the flow above to:
- HEAD /api/v3/SalesOrders/${OrderType}/${OrderId} // get etag header, no data
- PATCH /api/v3/SalesOrders/${OrderType}/${OrderId} // use etag from above and capture eTAG from reply
- DELETE /api/v3/SalesOrders/${OrderType}/${OrderId} /lines?lineIds=1,2,3,4,5 // use from above and capture eTAG from reply
- POST /api/v3/SalesOrders/${OrderType}/${OrderId} /lines // use etag from above
That 6 calls would be 4 and smaller ones too, saving round trips and bandwith.
Solved! Go to Solution.
1 REPLY 1
Sorry never mind must have been cross-eyed yesterday night I see the ETag now. Can;t delete this post.
