* The requirement to specify an id in a GET adds complexity for
consumers of an API. The *essential* data that a server needs in order
to formulate a response is just the "method" and "params", and the id
is nice, but not actually necessary except for the existence of
"notifications" in the base JSON-RPC spec. Perhaps notifications
should be indicated via an HTTP client header instead, or by the
client simply choosing to ignore the return value.
* Why does the GET specification require Base64-encoding of params?
I'm an implementer on the client and server side, and in JavaScript
clients, not only is base64 encoding difficult, it's unnecessarily
time-consuming and adds complexity. Why not just urlencode the params?
* The mapping of errors to HTTP status codes seems like an unnecessary
complexity from both the client and server implementation viewpoint.
One part of XML-RPC that I've never had a problem with is that it
always returns a 200 unless there is a significant underlying error,
and the RPC client deals with the error by the error code in the RPC
protocol.
* The requirement to specify an id in a GET adds complexity for
consumers of an API. The *essential* data that a server needs in order
to formulate a response is just the "method" and "params", and the id
is nice, but not actually necessary except for the existence of
"notifications" in the base JSON-RPC spec. Perhaps notifications
should be indicated via an HTTP client header instead, or by the
client simply choosing to ignore the return value.
Ah, yeah, sorry, I should have been clearer. I did know that this was
one of the purposes of the "id" field. I was just pointing out that it's
not *strictly* necessary, and so it shouldn't be *required*.
On 06/04/2010 08:54 AM, Erik Nedwidek aka Raycaster wrote:
> They are base64 encoded and then url encoded if I'm reading the spec
> right. Base64 would make for smaller payloads when doing binary data.
> [snip]
Yes, that's correct. "Make for smaller payloads" in a *specification*
sounds like a premature optimization, though. Also, normal JSON encoders
usually already encode binary data as base64, so you'd just be
double-encoding in the binary case.
> There are plenty of libraries for each language for encoding
> and decoding so you shouldn't need to do the heavy lifting yourself.
Yes, but it's not strictly necessary, so it probably shouldn't be in
the specification. Just because something is *possible* for an
implementer to do doesn't mean that it's a good idea to add that
additional complexity. If an implementation feels the need to optimize
in that way, then it can specify that in its API docs. Or you could do
an extension spec that specifies params64, or params_encoding, even.
-Max
--
http://www.everythingsolved.com/
Competent, Friendly Bugzilla and Perl Services. Everything Else, too.
Pushing the notification indication into the http header would be
pushing a core part of the spec into the transport layer. This goes
against one of the core tenets of the spec which is that it is
transport agnostic. Also, not all transports have a 'header' that
such a flag could be pushed into.
Cheers,
Rasjid.
> --
> You received this message because you are subscribed to the Google Groups
> "JSON-RPC" group.
> To post to this group, send email to json...@googlegroups.com.
> To unsubscribe from this group, send email to
> json-rpc+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/json-rpc?hl=en.
>