JSON-P base view for Grok.
Project description
JSON-P base view for Grok
This 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 Ok
Content-Length: 30
Content-Type: application/json
<BLANKLINE>
jQuery-123({'foo': 1234});
CHANGELOG
0.1 (2012-04-12)
initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sw.grokcore.jsonp-0.1.tar.gz
(5.4 kB
view details)
File details
Details for the file sw.grokcore.jsonp-0.1.tar.gz.
File metadata
- Download URL: sw.grokcore.jsonp-0.1.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
222b278080262886fb82c6c8a71f9ac2ab28a87f7df6a48d0681141595e73417
|
|
| MD5 |
b17c567c93790b9db016c0e8bd72f164
|
|
| BLAKE2b-256 |
1d44dddbb867fad6d46c42089319963a85a84e768f27549904c6a3f4fe4b4e3e
|