I posted this question yesterday with no replies. Is it that few use the
restful interface, and I should just work out my own solution, or did I post
it to the wrong list.
John
On Thu, Sep 23, 2010 at 10:13 AM, John Preston <[email protected]> wrote:
> I am trying to add a shapefile datastore to a geoserver 2.0.2 instance. I
> have been able to get it to work using the following command
>
> curl -u admin:geoserver -v -XPUT -H 'Context-type: application/zip'
> --data-binary '/home/path/to/test.zip'
> http://localhost:8080/geoserver/rest/workspaces/sf/datastore/sf/file.shp
>
> However I already have the shape files stored in a particular directory and
> I simply want to reference them. When I try the following command which I
> was told by a guy in the open-geo booth at FOSS4G-2010 it gives me an error.
>
> curl -u admin:geoserver -v -XPUT -H 'Content-type: text/plain' -d
> '/home/path/to/test.shp'
> http://localhost:8080/geoserver/rest/workspaces/sf/datastores/sf/external.shp<http://localhost:9090/geoserver/rest/workspaces/tt/datastores/tt/external.shp>
> * About to connect() to localhost port 8080 (#0)
> * Trying ::1... connected
> * Connected to localhost (::1) port 8080 (#0)
> * Server auth using Basic with user 'admin'
> > PUT /geoserver/rest/workspaces/sf/datastores/sf/external.shp HTTP/1.1
> > Authorization: Basic YWRtaW46Z2Vvc2VydmVy
> > User-Agent: curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k
> zlib/1.2.3.3 libidn/1.15
> > Host: localhost:8080
> > Accept: */*
> > Content-type: text/plain
> > Content-Length: 20
> >
> < HTTP/1.1 400 Bad Request
> < Transfer-Encoding: chunked
> < Server: Jetty(6.1.8)
> <
> * Connection #0 to host localhost left intact
> * Closing connection #0
> Could not determine format. Try setting the Content-type header.
>
> It is supposedly telling me that the text/plain content type is unknown but
> I can't get any other combination other then application/zip to work.
>
> Can anyone say what I'm doing wrong or is what I'm trying to do not posible
> and I need to program my own restful interface to do it.
>
> John
>
>
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel