play.api.test

FakeRequest

case class FakeRequest [A] (method: String, uri: String, headers: FakeHeaders, body: A, remoteAddress: String) extends Request[A] with Product with Serializable

Fake HTTP request implementation.

A

The body type.

method

The request HTTP method.

uri

The request uri.

headers

The request HTTP headers.

body

The request body.

remoteAddress

The client IP.

Linear Supertypes
Serializable, Serializable, Product, Equals, Request[A], RequestHeader, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. FakeRequest
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Request
  7. RequestHeader
  8. AnyRef
  9. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FakeRequest (method: String, uri: String, headers: FakeHeaders, body: A, remoteAddress: String)

    method

    The request HTTP method.

    uri

    The request uri.

    headers

    The request HTTP headers.

    body

    The request body.

    remoteAddress

    The client IP.

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. lazy val accept : Seq[String]

    returns

    The media types set in the request Accept header, not sorted in any particular order.

    Definition Classes
    RequestHeader
  7. lazy val acceptLanguages : Seq[Lang]

    The Request Langs, extracted from the Accept-Language header.

    The Request Langs, extracted from the Accept-Language header.

    Definition Classes
    RequestHeader
  8. def accepts (mediaType: String): Boolean

    Check if this request accepts a given media type.

    Check if this request accepts a given media type.

    Definition Classes
    RequestHeader
  9. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  10. val body : A

    The request body.

    The request body.

    Definition Classes
    FakeRequestRequest
  11. def canEqual (arg0: Any): Boolean

    Definition Classes
    FakeRequest → Equals
  12. lazy val charset : Option[String]

    Returns the charset of the request for text-based body

    Returns the charset of the request for text-based body

    Definition Classes
    RequestHeader
  13. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. lazy val contentType : Option[String]

    Returns the value of the Content-Type header (without the ;charset= part if exists)

    Returns the value of the Content-Type header (without the ;charset= part if exists)

    Definition Classes
    RequestHeader
  15. lazy val cookies : Cookies

    The HTTP cookies.

    The HTTP cookies.

    Definition Classes
    RequestHeader
  16. lazy val domain : String

    The HTTP domain

    The HTTP domain

    Definition Classes
    RequestHeader
  17. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  18. def equals (arg0: Any): Boolean

    Definition Classes
    FakeRequest → Equals → AnyRef → Any
  19. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  20. lazy val flash : Flash

    Parses the Flash cookie and returns the Flash data.

    Parses the Flash cookie and returns the Flash data.

    Definition Classes
    RequestHeader
  21. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  22. def hashCode (): Int

    Definition Classes
    FakeRequest → AnyRef → Any
  23. val headers : FakeHeaders

    The request HTTP headers.

    The request HTTP headers.

    Definition Classes
    FakeRequestRequestHeader
  24. lazy val host : String

    The HTTP host (domain, optionally port)

    The HTTP host (domain, optionally port)

    Definition Classes
    RequestHeader
  25. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  26. def map [B] (f: (A) ⇒ B): Request[B]

    Transform the request body.

    Transform the request body.

    Definition Classes
    Request
  27. val method : String

    The request HTTP method.

    The request HTTP method.

    Definition Classes
    FakeRequestRequestHeader
  28. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  29. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  30. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  31. lazy val path : String

    The request path.

    The request path.

    Definition Classes
    FakeRequestRequestHeader
  32. def productArity : Int

    Definition Classes
    FakeRequest → Product
  33. def productElement (arg0: Int): Any

    Definition Classes
    FakeRequest → Product
  34. def productIterator : Iterator[Any]

    Definition Classes
    Product
  35. def productPrefix : String

    Definition Classes
    FakeRequest → Product
  36. lazy val queryString : Map[String, Seq[String]]

    The request query String

    The request query String

    Definition Classes
    FakeRequestRequestHeader
  37. lazy val rawQueryString : String

    Returns the raw query string.

    Returns the raw query string.

    Definition Classes
    RequestHeader
  38. val remoteAddress : String

    The client IP.

    The client IP.

    Definition Classes
    FakeRequestRequestHeader
  39. lazy val session : Session

    Parses the Session cookie and returns the Session data.

    Parses the Session cookie and returns the Session data.

    Definition Classes
    RequestHeader
  40. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  41. def toString (): String

    Definition Classes
    RequestHeader → AnyRef → Any
  42. val uri : String

    The request uri.

    The request uri.

    Definition Classes
    FakeRequestRequestHeader
  43. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  44. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  45. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  46. def withCookies (cookies: Cookie*): FakeRequest[A]

    Constructs a new request with additional Cookies.

  47. def withFlash (data: (String, String)*): FakeRequest[A]

    Constructs a new request with additional Flash.

  48. def withFormUrlEncodedBody (data: (String, String)*): FakeRequest[AnyContentAsFormUrlEncoded]

    Set a Form url encoded body to this request.

  49. def withHeaders (newHeaders: (String, String)*): FakeRequest[A]

    Constructs a new request with additional headers.

  50. def withJsonBody (node: JsValue, _method: String = Helpers.POST): FakeRequest[AnyContentAsJson]

    Sets a JSON body to this request.

    Sets a JSON body to this request. The content type is set to application/json. The method is set to POST.

    node

    the JSON Node.

    _method

    The request HTTP method, POST by default.

    returns

    the current fake request

  51. def withSession (newSessions: (String, String)*): FakeRequest[A]

    Constructs a new request with additional session.

Deprecated Value Members

  1. def productElements : Iterator[Any]

    Definition Classes
    Product
    Annotations
    @deprecated
    Deprecated

    use productIterator instead

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Request[A]

Inherited from RequestHeader

Inherited from AnyRef

Inherited from Any