[Registry-dev] Query string and queries

Glen Daniels glen at wso2.com
Fri Apr 18 06:01:25 PDT 2008


Hi team:

When you put() a SQL query to a particular place in the registry, you 
are then able to use the executeQuery() API in Java to run that query. 
executeQuery() takes a Map of parameters to fill in the template values 
in the SQL, but when doing this remotely you have to make that work in 
the URL.  Our old way of doing this was to use the ";query" 
discriminator on a resource URL like this:

GET /registry/query1;query

...and seeing that would let the AtomRegistry know to look for a custom 
HTTP header called "parameters" which contained a string of encoded 
parameters.

So first off, this was a little weird since we wanted to avoid HAVING to 
know if a given URL was a query or not.  Second, using a custom HTTP 
header is just bad news; not very interoperable, nor very easy to use 
from a browser.

So, I'm in the midst of changing it to act like this instead - a GET to 
a resource that's a query will execute the query, and the query string 
of the URL will contain the parameters, i.e.:

GET /registry/query1?1=foo&2=bar

If there are no params, just

GET /registry/query1

will execute the query and return the results.

This is, I think, much cleaner and more in sync with mainline HTTP usage 
(this is after all precisely what the query string is for).

Thanks,
--Glen



More information about the Registry-dev mailing list