API Proposal
Please note that we do not intend the average user to use these commands and XML files to update GWC's configuration. We hope to provide a JavaScript? GUI, the commands below are for advanced users and those that want to modify GWC's configuration programatically. As shown below, the default user is geowebcache and default password is secured, but we may switch to shipping with a scrambled password for increased security.
| URI | GET | DELETE | PUT | POST |
| /rest/layers/ | Retrieve a listing of all layers | - | - | - |
| /rest/layers/{layer} | Retrieve the configuration for the layer | Delete this layer | - | Create a new layer (POST to non-existing layer) Overwrite existing layer (POST to existing layer) |
To test, use cURL following the guidelines below:
DELETE
- curl -X DELETE [url]
- Example: curl -X DELETE http://geowebcache:secured@localhost:8080/geowebcache/rest/layers/topp:states
POST XML
- curl -T layerTest.xml -X POST -H 'Content-type: application/xml' [url]
- Example: curl -T layerTest.xml -X POST -H 'Content-type: application/xml' http://geowebcache:secured@localhost:8080/geowebcache/rest/layers/topp:states
POST JSON
- Important note: As of the 1.0-alpha1 release, posting via JSON does not work and you must use XML as described above.
- curl -T layerTest.json -X POST -H 'Content-type: application/json' [url]
- Example: curl -T layerTest.json -X POST -H 'Content-type: application/json' http://geowebcache:secured@localhost:8080/geowebcache/rest/layers/topp:states
GET XML
- To test GET point your favorite browser to a url representing a layer
- http://geowebcache:secured@localhost:8080/geowebcache/rest/layers/topp:states.xml
- It is currently legal to drop the .xml at the end, but we recommend you use it
