用过arcgis server发布图层后都有一个restAPI服务地址,但是geoserver找不到这样的直接地址。
内容大多来自,
https://www.cnblogs.com/w-wanglei/p/6624915.html
只是初接触很困惑rest怎么出来的。
其实可以直接在地址栏里面拼接。
http://localhost:8080/geoserver/rest/namespaces,直接访问即可
使用python添加一个工作空间
import requests myUrl = 'http://localhost:8080/geoserver/rest/namespaces' file = open('requestBody.xml','r') payload = file.read() headers = {'Content-type': 'text/xml'} resp = requests.post(myUrl, auth=('admin','geoserver'),data=payload, headers=headers) resp.status_code