You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(NOTE: filing this issue here because it applies to multiple Gateway services, and in anticipation that we will be migrating the services' code to this repo as a monorepo, and that any modifications to the Gateway APIs resulting from this issue will not take place until after such a monorepo migration. We'll also probably want to wait until Node.js 22.x is promoted to LTS)
Description
As a developer, I expect REST methods to clearly embody the underlying HTTP request. Previously, in order to support a complex query (ie, where the resource query parameters are either too long for a standard URI, or have problems with encoding/escaping), there have been two options:
Use a GET request with a body. Although this does not violate the HTTP standard, its use is controversial and may not be supported by all server implementations.
Use a POST request to communicate the query parameters in the body of the message, but the endpoint is actually idempotent as relates to the data itself, and behaves more or less like a GET. This is a common approach, but disliked as a "necessary evil"
Potential Solution
Use the new HTTP QUERY operator, which is, for all intents and purposes, "GET with a body". The QUERY operator is now supported by Node.js 22.2.0.
References
See here for an explanation and examples. For some of our more common Gateway use cases, the "query with indirect response" might be a good approach. In this model, the QUERY endpoint responds with an HTTP 303 "See Other" response containing a URL which maps to a GET request for the query results. This is useful for many of our blockchain operations for which we cannot provide results synchronously (for instance, a search request that requires scanning the chain for results)
The text was updated successfully, but these errors were encountered:
(NOTE: filing this issue here because it applies to multiple Gateway services, and in anticipation that we will be migrating the services' code to this repo as a monorepo, and that any modifications to the Gateway APIs resulting from this issue will not take place until after such a monorepo migration. We'll also probably want to wait until Node.js 22.x is promoted to LTS)
Description
As a developer, I expect REST methods to clearly embody the underlying HTTP request. Previously, in order to support a complex query (ie, where the resource query parameters are either too long for a standard URI, or have problems with encoding/escaping), there have been two options:
Potential Solution
Use the new HTTP
QUERY
operator, which is, for all intents and purposes, "GET
with a body". TheQUERY
operator is now supported by Node.js 22.2.0.References
See here for an explanation and examples. For some of our more common Gateway use cases, the "query with indirect response" might be a good approach. In this model, the
QUERY
endpoint responds with an HTTP 303 "See Other" response containing a URL which maps to aGET
request for the query results. This is useful for many of our blockchain operations for which we cannot provide results synchronously (for instance, a search request that requires scanning the chain for results)The text was updated successfully, but these errors were encountered: