Field separators, again
paul at ciphergoth.org
Tue Jun 7 16:27:21 PDT 2005
The draft spec currently says that x-www-form-urlencoded is used to
encode the replies to get_authkey requests. However, it's easy to
imagine that for some consumers this could be a bind. The environment
they run in may not give them easy direct access to a parser for this
format - it may have to be part of a GET request.
Rolling your own parser for this is a bit of a pain, too - you have to
Would it be simpler to go for something like this?
We're not expecting newlines in the output, and pretty much everything
can make a decent fist of parsing line-oriented output.
The nice thing about this is that we can also use it for our token
format, replacing the rather ugly and unreadable
with the far more debuggable
(using mode:id_res to do the job of assert_identity in the other format)
How does that seem?
Brad suggests that servers can provide more than one format, on the
assumption that servers are smart but consumers are dumb, so servers
should provide whatever consumers will find most convenient. One thing
some consumers might prefer, for example, would be XML. I think that's
overkill for now; everyone should be able to parse the format here with
hardly any code. In Python, for example, you can do it with
dict([(lambda x, y: (x, y.rstrip()))(*l.split(':',1)) for l in f])
What do other poeple think?
\/ o\ Paul Crowley, paul at ciphergoth.org
More information about the yadis