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
Some GeoServer REST API responses do not provide much information about the resource(s) being manipulated.
For example, creating a workspace just returns HTTP 201. Let's strive for providing a useful representation of the resource being worked upon in geoserverx. In this concrete example, our response would include a representation of the workspace that had just been created.
Note that this means we will sometimes need to make more than one request to GeoServer in order to fulfill our task. Going back to the previous example, this would mean that when geoserverx is asked to create a workspace it would need to:
Make a first request to GeoServer to create the workspace;
Make another request to get back a representation of the newly-created workspace.
We can even implement the code in order to have a lower-level API that mimics GeoServer and would be suited for performance-minded use cases and a normal API that gives back the more useful response. Something like this:
# lower-level API - makes a single HTTP request to GeoServer, returns whatever GeoServer returnsdefcreate_workspace_bare() ->typing.Any:
...
# normal API - makes multiple HTTP requests to GeoServer and returns an object# this calls into the lower-level API functions defcreate_workspace() ->WorkspaceModel:
...
This will be mostly applicable for commands that perform creation and editing actions, since in those cases we can imagine it would be most useful for calling code to be given back a representation of the entities being worked upon after GeoServer has committed its changes.
The text was updated successfully, but these errors were encountered:
Some GeoServer REST API responses do not provide much information about the resource(s) being manipulated.
For example, creating a workspace just returns
HTTP 201
. Let's strive for providing a useful representation of the resource being worked upon in geoserverx. In this concrete example, our response would include a representation of the workspace that had just been created.Note that this means we will sometimes need to make more than one request to GeoServer in order to fulfill our task. Going back to the previous example, this would mean that when geoserverx is asked to create a workspace it would need to:
We can even implement the code in order to have a lower-level API that mimics GeoServer and would be suited for performance-minded use cases and a normal API that gives back the more useful response. Something like this:
This will be mostly applicable for commands that perform creation and editing actions, since in those cases we can imagine it would be most useful for calling code to be given back a representation of the entities being worked upon after GeoServer has committed its changes.
The text was updated successfully, but these errors were encountered: