Time for action – managing workspaces
We are going to use REST operations with workspaces. In this section, as in the others contained in this chapter, we will use both cURL and Python to perform the same operation. The examples are shown in a Linux shell, but cURL and Python syntaxes are identical in a Windows shell.
The first step looks at which workspaces are defined in your GeoServer instance. This requires a GET operation. The following code shows you the syntax. cURL has a lot of options, you can have a look at all of them running it with the
curl --help
command from Linux and Windows. On Linux you can also have a look at the manual with the commandman curl
. The first option we use is–u
. It stands for user authentication and you have to insert the user ID and password you set in Chapter 2, Getting Started with GeoServer, when we modified the default password.The
-v
option tells cURL to run verbosely, so it will output detailed information on the request processing. The-X
option defines...