Skip to main content
Question

Response from odata batch contains duplicate Content-Length headers

  • March 3, 2025
  • 3 replies
  • 33 views

Forum|alt.badge.img+2
  • Do Gooder (Customer)
  • 4 replies

When doing odata batch-requests in APP10, the response contains duplicate Content-Length headers. I’m using .net package Simple.OData.Client to call the API, and this client detects this as an error and throws an exception: “

The header 'Content-Length' was specified multiple times. Each header must appear only once in a batch part.

 

Has anyone also had this problem, and found a solution?

 

The response i get is:

With errors highlighted in this style

 

--batch_76048087-845d-43fe-8bfd-6bc74ab4adef

Content-Type: multipart/mixed; boundary=changeset_a32e7278-3e2a-40db-b74d-4672974ed52b

--changeset_a32e7278-3e2a-40db-b74d-4672974ed52b

Content-Type: application/http

Content-Transfer-Encoding: binary

Content-ID: 1

HTTP/1.1 204 No Content

OData-Version: 4.0

Content-Length: 0

Content-Language: en-US

Content-Length: 0


--changeset_a32e7278-3e2a-40db-b74d-4672974ed52b

Content-Type: application/http

Content-Transfer-Encoding: binary

Content-ID: 2

HTTP/1.1 200 OK

OData-Version: 4.0

ETag: W/"Vy8iQUFBYU1UQUFWQUFJdklBQUFKOjIwMjUwMzAzMjAwNjIzIg=="

OData-EntityID: https://xxxxxxx:58080/main/ifsapplications/projection/v1/ShopOrderOperationsHandling.svc/ShopOrderOperations(OrderNo='2268244',ReleaseNo='%2A',SequenceNo='%2A',OperationNo=10)

Location: https://xxxxxxx:58080/main/ifsapplications/projection/v1/ShopOrderOperationsHandling.svc/ShopOrderOperations(OrderNo='2268244',ReleaseNo='%2A',SequenceNo='%2A',OperationNo=10)

Content-Language: en-US

Content-Type: application/json;ieee754compatible=true;odata.metadata=full

Content-Length: 14913

{"@odata.context":"……………..."}

--changeset_a32e7278-3e2a-40db-b74d-4672974ed52b

Content-Type: application/http

Content-Transfer-Encoding: binary

Content-ID: 3

HTTP/1.1 204 No Content

OData-Version: 4.0

Content-Length: 0

Content-Language: en-US

Content-Length: 0


--changeset_a32e7278-3e2a-40db-b74d-4672974ed52b--

--batch_76048087-845d-43fe-8bfd-6bc74ab4adef--

 

3 replies

Forum|alt.badge.img+2
  • Author
  • Do Gooder (Customer)
  • 4 replies
  • March 3, 2025

Perhaps i should also include the actions i invoke in the batch:

PrePostSave(Init = true)

<update shop-order-operation>

PrePostSave(Init = false)

And it is the PrePostSave actions that return the duplicate Content-Length headers.


matt.watters
Ultimate Hero (Partner)
Forum|alt.badge.img+26
  • Ultimate Hero (Partner)
  • 697 replies
  • March 4, 2025

@linkri you may get a better response by posting this in the Framework forum.

https://community.ifs.com/framework-experience-infrastructure-cloud-integration-dev-tools-50


Forum|alt.badge.img+2
  • Author
  • Do Gooder (Customer)
  • 4 replies
  • March 4, 2025

Thanks for the tips! Will try that.