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
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to