Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
ODataLib doesn't write relative URIs in OData batch operations #271
I received a change request regarding my library that generates OData requests using ODataLib. The library supports OData batch operations, and each operation is written using absolute URI - this is what ODataLib does.
Scenario when this doesn't work is a bit tricky and described here (object/Simple.OData.Client#122). There is a security layer and/or a load balancer in front of the processing server and the base URI for the OData request will no longer match the URI for each batch request in the body.
The developers tried to rewrite the generated batch payload, and as soon as they changed each operation's URI into a relative one, the batch request worked.
I tried to tweak ODataLib but didn't get the same result: it always writes the absolute URI for batch operations.
See if can use client hooks to change the request uri: http://odata.github.io/odata.net/#04-06-use-client-hooks-in-odata-client