sw.grokcore.jsonpJSON-P base view for Grok | |
Download |
sw.grokcore.jsonp Ranking & Summary
Advertisement
- License:
- ZPL
- Price:
- FREE
- Publisher Name:
- Sebastian Wehrmann
- Publisher web site:
- https://bitbucket.org/sweh/
sw.grokcore.jsonp Tags
sw.grokcore.jsonp Description
sw.grokcore.jsonp is a base view for Grok, which enables you to make JSON-P calls to your Grok application. It works nearly the same as the grokcore.json.JSON view, except the fact, that it requires the name of a JavaScript callback in the request into which it wraps the JSON data returned by your view.>>> import sw.grokcore.json>>> class MyView(sw.grokcore.jsonp.JSONP):... ...... def data(self):... return {'foo': 1234}>>> print http('GET /data?callback=jQuery-123 HTTP/1.1')HTTP/1.0 200 OkContent-Length: 30Content-Type: application/json< BLANKLINE >jQuery-123({'foo': 1234});Product's homepage
sw.grokcore.jsonp Related Software