Closed JurgenCruz closed 2 years ago
Hello @SuperJugy Thank you for considering the library and your issue.
I saw this possibility in the specifications a year ago and since my backend (own development) does not require this feature, I did not include anything about it Today thinking about the necessary modifications to be able to use post in the queries I think it is not complex to do it. It remains to define if this is something transversal to the entire api or only for some queries. In the blog post it's said that it is possible to mix parameters, part in the query string and part in the body ... I don't know whether to allow this behavior or to work with an all or nothing approach Any help or opinion is welcome. The changes in the code are not so many, the "complicated" thing is to see how to approach them without having a test backend. Regards
In my specific scenario I need everything in the request. But I guess having the flexibility would be better for future users that need it.
I unfortunately cannot help with a test backend, since we are working with a closed source. And my team didn't even work on the backend part.
Hi @SuperJugy
New in versión 0.78.0...
For global use bodyQueryOptions
. ApiConfig in they section options.
For custom query use bodyQueryOptions
for each fetch method as a parameter.
Regards
Thanks!
Hi, @diegomvh. I try to use "bodyQueryOptions" and it put query params into body of POST request. But I don't see "$query" word in URl as described on http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_PassingQueryOptionsintheRequestBody
I found getter in sources, but it looks like it's not used
get path() { return this._queryBody ?
${this._path}/${$QUERY}: this._path; }
Please, tell how it should works
Hi @Ipri You have found an error within the code. This feature has not been extensively tested since its initial implementation. Create some tests to test the basic options of using $query by setting the api options or on each request.
I hope it helps, these changes are for the next version (0.102.0 I guess) of the library. Thank you very much for your issue report.
Thank and you! I`ll hope next version will be soon)
Hi, I had a question. I need to consume a service that uses OData, but for some reason they are expecting the query in the request body instead of the query parameter. This appears to be supported in the standard: https://devblogs.microsoft.com/odata/passing-odata-query-options-in-the-request-body/ But wanted to know if your library has a way of consuming this way.
Thanks.