Re: this m=foo&c=bar thing
| From: | Joshua Eichorn | Date: | Mon, 17 Oct 2005 17:01:53 +0000 |
| Subject: | Re: this m=foo&c=bar thing | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21514@lists.php.net to get a copy of this message | ||
Ken Restivo wrote:
-----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. With a content-type of text/plain the jsolait method will never be supported and it shouldn't be. You have to sniff that content to know whats happening.In fact I don't see any good reason to support the jsolait client, that just leads to tons of complexity for very little gain. On not using the query string to pass the data, there is not reason that won't change overtime, but I don't see it as a large gain so its not a prioirity. -josh
- -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-----