none
ODATA.FEED Async support RRS feed

  • Question


  • Not sure if correct place. Does Power Query's OData.Feed method handle ODATA V3/V4 202's with location header. Or the ability to handle an asynchronous response.



    Explanation:

    So I have written an ODATA API using AWS lambda.

    Sometimes, a lot of data can exceed the 30 second gateway timeout. In the ODATA spec it says that you can return a status code of 202 with a Retry-After header and Location (it does mention if perfer: respond-async is given but ODATA v3 states a 202 can be given for async requests with no mention of this header). When I do return 202 it just fails with the message:



    An Unexpected 'EndOfInput' node was found when reading from the JSON reader. A 'StartObject' node was expected.



    I'm assuming its trying to parse the empty body. Am I returning something wrong or can it handle those type of responses.



    I could use redirects to handle it but that will run the risk of hitting a too many redirects error and it doesnt seem to listen to the retry-after header. 



    Is there an ideal way in Power Query to handle this case by just using Odata.Feed or am I forced to tell our clients to write logic on their end which is not ideal. 



    Also i am aware that there are improvements that I could make to our database solution to provide data quicker etc but right now don't have the opportunity. 

    Any advice would be appreciated.

    Darren
    Tuesday, September 3, 2019 12:48 PM

Answers

  • I believe we support both Retry-After and Location, but not in response to a 202. More specifically, both retries and redirects are done in response to certain HTTP status codes (which are completely different for each, so you can't do both at the same time), and 202 does not appear to be in either list (this is just our generic functionality for HTTP-based data sources, not anything OData specific). You mentioned this is because of gateway timeouts; the Retry-After status codes do include 504 Gateway Timeout.
    Tuesday, September 3, 2019 11:13 PM