MathiasPaumgarten/cane — pull request #46 by MathiasPaumgarten (2013-09-14 11:48:26+00:00)
Title: WIP. untested jsonp module

This is a helper module for __jsonp__ which I have pulled out of my latest project. It is work in progress mainly because it is untested.

I found it very hard to test this module. In order to test this properly it needs a receiving end of the call that is capable to produce an answer wrapped in the callback. A static file won't cut it in this case.

Do you have suggestions, @conradz?

We could also talk about the signature. I encode the optional parameters but don't do so in the `cane/net/request` module. This might lead to confusion. On the other hand, the way parameters are submitted over jsonp is simply different than using __POST__ requests.

Also - there is no validation if the callback gets executed. When a backend is used, that does not support JSON-P it will never complete. So very much WIP, but wanted to talk about it.