Ticket #1437 (closed defect: fixed)
JSONP parameter in Action API
Reported by: | dread | Owned by: | dread |
---|---|---|---|
Priority: | major | Milestone: | ckan-sprint-2011-11-07 |
Component: | ckan | Keywords: | |
Cc: | zephod, kindly | Repository: | ckan |
Theme: | none |
Description (last modified by dread) (diff)
Action API needs JSONP support - be able to return responses encapsulated in a function of a supplied name. This is important for remote sites running javascript to interact with a CKAN site.
Specifying the callback parameter is the way we've achieved JSONP with the RESTful and Search APIs. It should work like this:
curl http://test.ckan.net/api/action/package_show?callback=jsoncallback -d '{"id": "fd788e57-dce4-481c-832d-497235bf9f78"}'
Or maybe the callback should be specified in the payload in the context or data_dict?
(My understanding is that CORS is similar - when more browsers support it, can we drop JSONP?)
Change History
Note: See
TracTickets for help on using
tickets.
This can be fixed with one line of code, so I'm doing it for release 1.5.