-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$batch failed - Error: Expected 'OData-Version' header with value '4.0' but received value 'null' in response for http://localhost:5000/odata/$batch #3601
Comments
Hello @siasty ! Thanks for using OData V4! We apologize for any inconvenience caused! I'm terribly sorry, but I cannot spot any mistake here. Everything looks fine, no idea why this fails. Please try to debug. Best regards, |
Hi @ThomasChadzelek thanks for the quick reply, can you help me because I don't know what to look for what scope should have odata-version ? I have no odata-version only in request body but this function should not get from the response headers ? |
Hi @siasty, It looks as if that is a CORS request. But CORS regulates the visibility of the response headers in JavaScript via the header "Access-Control-Expose-Headers". For OData V4 to work with CORS, "OData-Version" must be given here. You should also allow X-CSRF-Token, ETag and SAP-Messages. Best Regards BTW. The scope of fnGetHeader in the screenshot has the response headers in "a" and the request headers in "b". So only the Content-Type response header is visible to OData V4, as it is a CORS-safelisted response header. |
you're right I added Access-Control-Expose-Headers to the controler odata And it works. thx. |
Hi, I have a problem with batch request
but in respod in batch is OK... and return data and also odata version
what is wrong?
The text was updated successfully, but these errors were encountered: