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
-
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
final
def
isInstanceOf[T0]: Boolean
-
-
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
val
padding: String
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
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: