this m=foo&c=bar thing
| From: | Ken Restivo | Date: | Sun, 16 Oct 2005 23:16:24 +0000 |
| Subject: | this m=foo&c=bar thing | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-21508@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm also not sure I'm comfortable with this whole c=foo&m=bar calling method.
In surveying some various JSON servers and clients, I'm starting to prefer the jsolait way: it
sends JSON calls as JSON.
POST /dev/tests/simplejsonserver.php HTTP/1.1
Host: www
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050730 Firefox/1.0.6 (Debian
package 1.0.6-2)
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Content-Type: text/plain
Content-Length: 57
Cookie: coop=5f79a18ab049d2626d6ed4384f97206e
Pragma: no-cache
Cache-Control: no-cache
{"id": "httpReq", "method": "foo", "params":
["bar baz"]}
In other words, instead of using c and m variables, it uses JSON to encapsulate the method call.
I'm interested in keeping my stuff portable. I may want to use, for example, jsolait on the
client side, and HTML_AJAX on the server side, or HTML_AJAX on the client side, and a service on
Python or some other language, on the server side.
Maybe there's some reason why this isn't a good idea; I don't know. I just assumed
that all JSON libraries used a standard calling convention but I guess that's not so.
- -ken
- --
- ---------------
The world's most affordable web hosting.
http://www.nearlyfreespeech.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFDUt9Ie8HF+6xeOIcRAvHmAKDiWIyLDEAz7lQfQbaf+9Hseoa9jQCeId6N
YwXG6v8eMu4aRJsmKlJlDpY=
=fu0u
-----END PGP SIGNATURE-----