Ticket #1437 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

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

comment:1 Changed 2 years ago by dread

  • Owner set to dread
  • Status changed from new to assigned
  • Type changed from enhancement to defect
  • Description modified (diff)
  • Milestone changed from ckan-v1.6 to current-ckan-sprint-2011-11-07

This can be fixed with one line of code, so I'm doing it for release 1.5.

comment:2 Changed 2 years ago by dread

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed in cset:5d0bf20a1746 for 1.5. Broken since 1.4.3.

Note: See TracTickets for help on using tickets.