[OSM-dev] XML over REST? (was: Consensus on areas?)
Immanuel Scholz
immanuel.scholz at gmx.de
Wed Aug 30 09:35:35 BST 2006
Hi,
> About api i was thinking it could be usefull to implement xml formatted
> response. With this you may give to clients a structured response, error
> code, error text and so on.
Inventing some error structure and reporting errors via XML is surely one
possible way of solving problems with bad formatted responses.
Reporting errors via http error codes/strings (which is part of the REST
interface) is another way.
The server moved from XMLRPC (which has nicely XML errors defined) to REST
(using http errorstrings) some time ago. So you propose to implement a
mixture of both?
> Some weeks ago, some way create requests gived me a mysql error. A simple
> editor not checking data is numerical, could convert that string in a
> '0'.
If the server gives you something like a "200 OK" and then do not send
valid XML data but some funny mysql strings, it is a server bug and should
be fixed.
You can't fix bugs with specification (Except if you define the buggy
behaviour to be conform, of course ;)
> Adopting xml will prevent some similiar race conditions and more
> flessibility in response parsing then actual http codes.
I don't see where an illegal response is a race condition. (Race
conditions are more than one entities which races about some ressources).
I even don't see how it will prevent any bugs.
However, if it is easier to send back an xml error instead of a http error
message, then I have no problem with it.. *shrug*
Ciao, Imi
More information about the dev
mailing list