Skip to main content

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

This version

0.1

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 hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page