Optional HTTP trailing headers for multi-part SPARQL responses - Amazon Neptune
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Optional HTTP trailing headers for multi-part SPARQL responses


This feature is available starting in Neptune engine release

The HTTP response to SPARQL queries and updates is often returned in more than one part or chunk. It can be hard to diagnose a failure that occurs after a query or update begins sending these chunks, especially since the first one arrives with an HTTP status code of 200.

Unless you explicitly request trailing headers, Neptune only reports such a failure by appending an error message to the message body, which is usually corrupted.

To make detection and diagnosis of this kind of problem easier, you can include a transfer-encoding (TE) trailers header (te: trailers) in your request (see, for example, the MDN page about TE request headers). Doing this will cause Neptune to include two new header fields within the trailing headers of the response chunks:

  • X-Neptune-Status  –   contains the response code followed by a short name. For instance, in case of success the trailing header would be: X-Neptune-Status: 200 OK. In the case of failure, the response code would be an Neptune engine error code such as X-Neptune-Status: 500 TimeLimitExceededException.

  • X-Neptune-Detail  –   is empty for successful requests. In the case of errors, it contains the JSON error message. Because only ASCII characters are allowed in HTTP header values, the JSON string is URL encoded. The error message is also still appended to the response message body.