case class Jsonp(padding: String, json: JsValue) extends Product with Serializable
Instance Constructors
- new Jsonp(padding: String, json: JsValue)
Value Members
- final def !=(arg0: Any): Boolean
- final def ##: Int
- final def ==(arg0: Any): Boolean
- final def asInstanceOf[T0]: T0
- def clone(): AnyRef
- final def eq(arg0: AnyRef): Boolean
- final def getClass(): Class[_ <: AnyRef]
- final def isInstanceOf[T0]: Boolean
- val json: JsValue
- final def ne(arg0: AnyRef): Boolean
- final def notify(): Unit
- final def notifyAll(): Unit
- val padding: String
- def productElementNames: Iterator[String]
- final def synchronized[T0](arg0: => T0): T0
- final def wait(arg0: Long, arg1: Int): Unit
- final def wait(arg0: Long): Unit
- final def wait(): Unit
Deprecated Value Members
- def finalize(): Unit
Inherited from Product
Inherited from Equals
Inherited from AnyRef
Inherited from Any
JSONP helper.
Example of use, provided the following route definition:
GET /my-service Application.myService(callback: String)
The following action definition:
And the following request:
The response will have content type “application/javascript” and will look like the following:
Another example, showing how to serve either JSON or JSONP from the same action, according to the presence of a “callback” parameter in the query string: