Opened 13 years ago

Closed 12 years ago

#199 closed enhancement (fixed)

ways deleted returns 404, while not created ways return 200

Reported by: erik@… Owned by: steve@…
Priority: trivial Milestone:
Component: api Version:
Keywords: api ways http request Cc:

Description

Ways that doesn't exist should return 404, ways that haven't been created will not return 404. Perhaps they should?

curl -vu $userpass http://www.openstreetmap.org/api/0.3/way/1
curl -vu $userpass http://www.openstreetmap.org/api/0.3/way/100000000000000
curl -vu $userpass http://www.openstreetmap.org/api/0.3/way/10000

These curl lines will fetch one way that is deleted one that was never created and one that exists. first and second should return 404, and only the third should return a 200.

curl -vu $userpass http://www.openstreetmap.org/api/0.3/way/100000000000000
* About to connect() to www.openstreetmap.org port 80
*   Trying 128.40.59.140... connected
* Connected to www.openstreetmap.org (128.40.59.140) port 80
* Server auth using Basic with user 'erik@tiq.com'
> GET /api/0.3/way/100000000000000 HTTP/1.1
> Authorization: Basic ZXJpa0B0aXEuY29tOmRlYmNvbmZzcGVjaWFs
> User-Agent: curl/7.14.0 (x86_64-pc-linux-gnu) libcurl/7.14.0 OpenSSL/0.9.7g zlib/1.2.3 libidn/0.5.13
> Host: www.openstreetmap.org
> Accept: */*
>

< HTTP/1.1 200 OK
< Date: Wed, 19 Apr 2006 08:40:57 GMT
< Server: Apache/2.0.55 (Debian) mod_ruby/1.2.4 Ruby/1.8.4(2005-10-29) DAV/2 SVN/1.2.3 PHP/4.4.0-4
< Transfer-Encoding: chunked
< Content-Type: text/plain
* Connection #0 to host www.openstreetmap.org left intact
* Closing connection #0




# curl -vu $userpass http://www.openstreetmap.org/api/0.3/way/10000
* About to connect() to www.openstreetmap.org port 80
*   Trying 128.40.59.140... connected
* Connected to www.openstreetmap.org (128.40.59.140) port 80
* Server auth using Basic with user 'erik@tiq.com'
> GET /api/0.3/way/10000 HTTP/1.1
> Authorization: Basic ZXJpa0B0aXEuY29tOmRlYmNvbmZzcGVjaWFs
> User-Agent: curl/7.14.0 (x86_64-pc-linux-gnu) libcurl/7.14.0 OpenSSL/0.9.7g zlib/1.2.3 libidn/0.5.13
> Host: www.openstreetmap.org
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Wed, 19 Apr 2006 08:41:41 GMT
< Server: Apache/2.0.55 (Debian) mod_ruby/1.2.4 Ruby/1.8.4(2005-10-29) DAV/2 SVN/1.2.3 PHP/4.4.0-4
< Transfer-Encoding: chunked
< Content-Type: text/plain
<?xml version="1.0"?>
<osm version="0.3" generator="OpenStreetMap server">
  <way id="10000" timestamp="2006-04-16 21:28:26">
    <seg id="678322"/>
    <tag k="name" v="Lark St"/>
    <tag k="from_zip" v="99507"/>
    <tag k="to_zip" v="99507"/>
  </way>
</osm>
* Connection #0 to host www.openstreetmap.org left intact
* Closing connection #0



curl -vu $userpass http://www.openstreetmap.org/api/0.3/way/1
* About to connect() to www.openstreetmap.org port 80
*   Trying 128.40.59.140... connected
* Connected to www.openstreetmap.org (128.40.59.140) port 80
* Server auth using Basic with user 'erik@tiq.com'
> GET /api/0.3/way/1 HTTP/1.1
> Authorization: Basic ZXJpa0B0aXEuY29tOmRlYmNvbmZzcGVjaWFs
> User-Agent: curl/7.14.0 (x86_64-pc-linux-gnu) libcurl/7.14.0 OpenSSL/0.9.7g zlib/1.2.3 libidn/0.5.13
> Host: www.openstreetmap.org
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Date: Wed, 19 Apr 2006 08:41:47 GMT
< Server: Apache/2.0.55 (Debian) mod_ruby/1.2.4 Ruby/1.8.4(2005-10-29) DAV/2 SVN/1.2.3 PHP/4.4.0-4
< Content-Length: 219
< Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /ruby/api/0.3/multi.rb was not found on this server.</p>
</body></html>
* Connection #0 to host www.openstreetmap.org left intact
* Closing connection #0

Change History (1)

comment:1 Changed 12 years ago by Tom Hughes

Resolution: fixed
Status: newclosed

In the rails port a way that has not been created gives 404 (Not Found) and a way that has been deleted gives 410 (Gone).

Note: See TracTickets for help on using tickets.