Skip to content

JSONP support for JSON output #23

@samatjain

Description

@samatjain

JSONP is a "standard" to allow cross-origin domain requests for use from JavaScript. It's an alternative to CORS (issue #22) for JavaScript interpreters.

Implementation is fairly simple: support a callback URL parameter ("callback" is an ad-hoc standard, which jQuery supports) in the GET/POST request.

E.g.

http://example.com/xapi/api/0.6/node/1.json?callback=an_arbitrary_name

Should return the otherwise normal JSON output "wrapped" in a function call, to a function named in the callback parameter. E.g. for the above:

E.g.

an_arbitrary_name(<JSON output here>)

A negative about JSONP: it, by itself, has no access control mechanism, so it may be a good idea to let users turn JSONP support off so random Websites on the Internet don't use their XAPI instances.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions