Based on Geoserver official documents, if the workspace doesn't exist, it retruns 404 Not Found
even if you send quietOnNotFound=true
parameters in GET
request. The only difference you can see just happens inside the geoserver .bat window.
If you send a GET
request for fetching workspace
that doesn't exist, you can see a message printed inside .bat window:
/geoserver/rest/workspaces/test.xml
responseCode => 404
responseMessage => No such workspace: 'test' found
Meanwhile, geoserver provides you quietOnNotFound=true
parameter that helps you to avoid geoserver prints this log message. However, as geoserver is telling us, you will receive 404 Not Found
as a response anyway.
/geoserver/rest/workspaces/test.xml?quietOnNotFound=true
responseCode => 404
responseMessage => ''
Please notice this is a REST API standard and not an exception
when you receive 404 Not Found
as response. You can handle this situation and inform the users that the workspace you are looking for, doesn't exist. This can be helpful when a user wants to create a new workspace and the system should check if this name
already exists or not.