public IGeoserverRestResponse PostLayer(IFeatureTypeInfo layer) { var uri = $@"workspaces/{layer.Workspace}/datastores/{layer.Datastore}/featuretypes"; var request = new ServiceRequest(uri); var featureTypeRoot = LayerInfoTranslator.TranslateToRequestFeatureTypeRoot(layer); request.Body = JsonConvert.SerializeObject(featureTypeRoot); var response = restService.Post(request); var output = new GeoserverRestResponse { Data = response.Data, Code = response.StatusCode }; return(output); }
public IGeoserverRestResponse PutLayer(IFeatureTypeInfo layer) { var uri = $@"layers/{layer.Name}"; var request = new ServiceRequest(uri); var layerRoot = LayerInfoTranslator.TranslateToRequestLayerRoot(layer); request.Body = JsonConvert.SerializeObject(layerRoot); var response = restService.Put(request); var output = new GeoserverRestResponse { Data = response.Data, Code = response.StatusCode }; return(output); }