pubnub / javascript

PubNub JavaScript SDK docs https://www.pubnub.com/docs/sdks/javascript
Other
553 stars 403 forks source link

Allow to send Json-RPC messages over POST #11

Closed piranna closed 11 years ago

piranna commented 11 years ago

Allow to send JSON data over POST messages to create a JSON-RPC communication channel, both for notifications (no response) or for remote calls (response, maybe only first is accepted by caller). To do it correctly according to the Json-RPC over HTTP specification, it's prefered to do it over POST messages instead of using a GET request as PubNub Javascript client does currently. Also this would allow to don't need to escape characters, so they could be send faster and using less bandwidth, so JSON structures could be bigger using the same space.

stephenlb commented 11 years ago

POST isn't supported by all browsers and is not a guarantee and therefore we do not provide that interface. Regardless you may send any JSON valid format. Also you don't need to escape chars! The JS SDK only needs to escape ? chars on the message. So that is cool though the JS SDK is a bit out of date on that aspect and can be changed really simply.

piranna commented 11 years ago

So user doesn't need to think about serialization or escape chars? Just send it over the JS SDK? Good to know then :-) I was worried about the transfer limits, because I'm sending big chunks of data (>1KB) over it, and I don't want to reach them. This also happen with binary data? Can I send it without worrying on serialization, unescape chars or data sizes as far I don't get the max chunk size? What's the current limit? I know that's about being able to be transfered over a single Ethernet packet, but what's the actual size of it?

2013/10/1 Stephen L. Blum notifications@github.com

POST isn't supported by all browsers and is not a guarantee and therefore we do not provide that interface. Regardless you may send any JSON valid format. Also you don't need to escape chars! The JS SDK only needs to escape ? chars on the message. So that is cool though the JS SDK is a bit out of date on that aspect.

— Reply to this email directly or view it on GitHubhttps://github.com/pubnub/javascript/issues/11#issuecomment-25414198 .

"Si quieres viajar alrededor del mundo y ser invitado a hablar en un monton de sitios diferentes, simplemente escribe un sistema operativo Unix." – Linus Tordvals, creador del sistema operativo Linux

stephenlb commented 11 years ago

We are in the process of upgrading the JS SDK to use the latest greatest transport enhancements. Will post an update with this is ready and all unit tests are passing.

On Tue, Oct 1, 2013 at 12:14 AM, Jesús Leganés Combarro < notifications@github.com> wrote:

So user doesn't need to think about serialization or escape chars? Just send it over the JS SDK? Good to know then :-) I was worried about the transfer limits, because I'm sending big chunks of data (>1KB) over it, and I don't want to reach them. This also happen with binary data? Can I send it without worrying on serialization, unescape chars or data sizes as far I don't get the max chunk size? What's the current limit? I know that's about being able to be transfered over a single Ethernet packet, but what's the actual size of it?

2013/10/1 Stephen L. Blum notifications@github.com

POST isn't supported by all browsers and is not a guarantee and therefore we do not provide that interface. Regardless you may send any JSON valid format. Also you don't need to escape chars! The JS SDK only needs to escape ? chars on the message. So that is cool though the JS SDK is a bit out of date on that aspect.

— Reply to this email directly or view it on GitHub< https://github.com/pubnub/javascript/issues/11#issuecomment-25414198> .

"Si quieres viajar alrededor del mundo y ser invitado a hablar en un monton de sitios diferentes, simplemente escribe un sistema operativo Unix." – Linus Tordvals, creador del sistema operativo Linux

— Reply to this email directly or view it on GitHubhttps://github.com/pubnub/javascript/issues/11#issuecomment-25429720 .

Cheers! Stephen Blum - CTO http://twitter.com/PubNub https://github.com/pubnub/pubnub-api - GitHub https://help.pubnub.com/ - Help Desk www.pubnub.com +1-425-830-6711

piranna commented 11 years ago

Good to know :-) El 01/10/2013 23:29, "Stephen L. Blum" notifications@github.com escribió:

We are in the process of upgrading the JS SDK to use the latest greatest transport enhancements. Will post an update with this is ready and all unit tests are passing.

On Tue, Oct 1, 2013 at 12:14 AM, Jesús Leganés Combarro < notifications@github.com> wrote:

So user doesn't need to think about serialization or escape chars? Just send it over the JS SDK? Good to know then :-) I was worried about the transfer limits, because I'm sending big chunks of data (>1KB) over it, and I don't want to reach them. This also happen with binary data? Can I send it without worrying on serialization, unescape chars or data sizes as far I don't get the max chunk size? What's the current limit? I know that's about being able to be transfered over a single Ethernet packet, but what's the actual size of it?

2013/10/1 Stephen L. Blum notifications@github.com

POST isn't supported by all browsers and is not a guarantee and therefore we do not provide that interface. Regardless you may send any JSON valid format. Also you don't need to escape chars! The JS SDK only needs to escape ? chars on the message. So that is cool though the JS SDK is a bit out of date on that aspect.

— Reply to this email directly or view it on GitHub< https://github.com/pubnub/javascript/issues/11#issuecomment-25414198> .

"Si quieres viajar alrededor del mundo y ser invitado a hablar en un monton de sitios diferentes, simplemente escribe un sistema operativo Unix." – Linus Tordvals, creador del sistema operativo Linux

— Reply to this email directly or view it on GitHub< https://github.com/pubnub/javascript/issues/11#issuecomment-25429720> .

Cheers! Stephen Blum - CTO http://twitter.com/PubNub https://github.com/pubnub/pubnub-api - GitHub https://help.pubnub.com/ - Help Desk www.pubnub.com +1-425-830-6711

— Reply to this email directly or view it on GitHubhttps://github.com/pubnub/javascript/issues/11#issuecomment-25492072 .

stephenlb commented 11 years ago

This is live! - https://github.com/pubnub/javascript#pubnub-cdn-javascript-sdk

piranna commented 11 years ago

What's live? The upgrades you told me yesterday? El 02/10/2013 06:59, "Stephen L. Blum" notifications@github.com escribió:

This is live! - https://github.com/pubnub/javascript#pubnub-cdn-javascript-sdk

— Reply to this email directly or view it on GitHubhttps://github.com/pubnub/javascript/issues/11#issuecomment-25513427 .

stephenlb commented 11 years ago
10-01-13 * NEW VERSION 3.5.43 *
. added enhancement by reducing number of escaped chars on publish
. removed blocking leave on non-ssl and non-jsonp transports for performance boost.
piranna commented 11 years ago

Oh cool! :-D

2013/10/2 Stephen L. Blum notifications@github.com

09-10-13 * NEW VERSION 3.5.43 * . added enhancement by reducing number of escaped chars on publish . removed blocking leave on non-ssl and non-jsonp transports for performance boost.

— Reply to this email directly or view it on GitHubhttps://github.com/pubnub/javascript/issues/11#issuecomment-25551566 .

"Si quieres viajar alrededor del mundo y ser invitado a hablar en un monton de sitios diferentes, simplemente escribe un sistema operativo Unix." – Linus Tordvals, creador del sistema operativo Linux