[Geoserver-users] GEOSERVER REST API AND POSTGIS TABLE

I want to communicate my problem and the solution to the community

My goal was to insert postgis table on geoserver with the rest api.

I use this request:
curl -u admin:geoserver -XPOST -H ‘Content-type: text/xml’ -d ‘layer4’ http://localhost:8080/geoserver/rest/workspaces/topp/datastores/bddUser/featuretypes

layer4 : postgis table
bddUser: database

If you have the error (like me):
:Unable to transform referenced envelope, crs has not yet been provided.

Make you sure you have specify the srs on the table (CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 4326))

Cheers

Jim