wai-extra-1.3.3.2: Provides some basic WAI handlers and middleware.

Portability | portable
Stability | Unstable
Maintainer | Michael Snoyman <michael@snoyman.com>
Safe Haskell | None

Network.Wai.Middleware.Jsonp

Description

Automatic wrapping of JSON responses to convert into JSONP.

Synopsis

- jsonp :: Middleware

# Documentation

jsonp :: Middleware Source

Wrap json responses in a jsonp callback.

Basically, if the user requested a "text/javascript" and supplied a "callback" GET parameter, ask the application for an "application/json" response, then convern that into a JSONP response, having a content type of "text/javascript" and calling the specified callback function.