Details
-
New Feature
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
Description
At the moment, for example, every method in exchanges is using GET method only. This is limiting because some external API services provide POST method based query APIs, not GET based APIs, sometimes. e.g, ElasticSearch, etc.
So, I'd like to propose a generic exchange hint argument in ResourceResolver (and ResourceBrokerService accordingly) like the following examples:
Resource resolve(String absPath, ExchangeHint exchangeHint) throws ResourceException; Resource resolve(String absPath, Map<String, Object> pathVariables, ExchangeHint exchangeHint) throws ResourceException; // ...
So, the underlying ResourceResolver implementation can read the extra exchangeHint argument which may include http method name (e.g, "POST", "PUT", "GET", etc. in http-backend), for instance.
An example code:
resourceResolver.resolve(absPath,
pathVariables,
ExchangeHintBuilder.create()
.method("POST")
.request(requestObject)
.build()
);