Recently, in the process of working, there is a need to manage the geoserver in an external program and find out that GeoServer's rest interface can meet the requirements by looking up data. The rest interface uses HTTP calls so that GeoServer can be simply invoked and configured without having to log on to the Web management interface.
GeoServer's website provides an introduction to rest's configuration APIs and examples at the address: http://docs.geoserver.org/stable/en/user/rest/index.html
The following program requests a list of layers in GeoServer by using the rest interface.
= "http://localhost:8180/geoserver/rest/layers/"= Curl_init (, Curlopt_returntransfer,);curl_setopt (, Curlopt_verbose,);curl_setopt (, Curlopt_get,= "Admin:geoserver";curl_setopt (, Curlopt_userpwd,, Curlopt_httpheader,("Accept:application/json")); = 200= Curl_exec (= Curl_getinfo (< span="">< span="">< span="">< span="">< span="">(< span="">[' Http_code < span=""> < span=""> < span=""> ']! = = "Request failed !" < span="">< span=""> < span="">< span="">< span="">< /c28>< span=""> < span="">= Json_decode ( , < span=""> < span=""> < span=""> < span=""> < span=""> = [' layers '] [' layer ' < span=""> < span=""> (< span=""> = = < span=""> < span=""> < span=""> < span=""> < span=""> < span=""> [] < span=""> = [' name ' < span=""> Json_encode (< span="">?>< span="">
Blog statement:
All the articles in this blog, in addition to the title "reproduced" In the words, all the rest of the articles are my original or in the review of the information after the completion of the reference to non-reproduced articles please indicate this statement. --Blog Park-pallee
http://www.bkjia.com/PHPjc/440337.html www.bkjia.com true http://www.bkjia.com/PHPjc/440337.html techarticle recently, in the process of working, there is a need to manage the geoserver in an external program and find out that GeoServer's rest interface can meet the requirements by looking up data. Rest interface uses ...