---
name: "Plack::Middleware::JSONP"
section: "3pm"
platform: "linux"
package: "libplack-perl"
version: "1.0051-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Plack::Middleware::JSONP"
---

# Plack::Middleware::JSONP(3pm)

Wraps JSON response in JSONP if callback parameter is specified

## NAME

Plack::Middleware::JSONP - Wraps JSON response in JSONP if callback parameter is specified

## SYNOPSIS

```
    enable "JSONP", callback_key => 'jsonp';
```

## DESCRIPTION

Plack::Middleware::JSONP wraps JSON response, which has Content-Type value either `"text/javascript"` or `"application/json"` as a JSONP response which is specified with the `"callback"` query parameter. The name of the parameter can be set while enabling the middleware.

This middleware only works with a non-streaming response, and doesn't touch the response otherwise.

## AUTHOR

Tatsuhiko Miyagawa

## SEE ALSO

Plack
