play.api.test

FakeRequest

Related Docs: object FakeRequest | package test

case class FakeRequest[A](method: String, uri: String, headers: Headers, body: A, remoteAddress: String = "127.0.0.1", version: String = "HTTP/1.1", id: Long = 666, tags: Map[String, String] = Map.empty[String, String], secure: Boolean = false) 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.

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

Instance Constructors

  1. new FakeRequest(method: String, uri: String, headers: Headers, body: A, remoteAddress: String = "127.0.0.1", version: String = "HTTP/1.1", id: Long = 666, tags: Map[String, String] = Map.empty[String, String], secure: Boolean = false)

    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. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Definition Classes
    AnyRef → Any
  4. lazy val acceptLanguages: Seq[Lang]

    The Request Langs extracted from the Accept-Language header and sorted by preference (preferred first).

    The Request Langs extracted from the Accept-Language header and sorted by preference (preferred first).

    Definition Classes
    RequestHeader
  5. lazy val acceptedTypes: Seq[MediaRange]

    returns

    The media types list of the request’s Accept header, sorted by preference (preferred first).

    Definition Classes
    RequestHeader
  6. def accepts(mimeType: String): Boolean

    Check if this request accepts a given media type.

    Check if this request accepts a given media type.

    returns

    true if mimeType matches the Accept header, otherwise false

    Definition Classes
    RequestHeader
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. val body: A

    The request body.

    The request body.

    Definition Classes
    FakeRequestRequest
  9. def certs: Future[IndexedSeq[Nothing]]

  10. 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
  11. def clone(): AnyRef

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

    Returns the value of the Content-Type header (without the parameters (eg charset))

    Returns the value of the Content-Type header (without the parameters (eg charset))

    Definition Classes
    RequestHeader
  13. lazy val cookies: Cookies

    The HTTP cookies.

    The HTTP cookies.

    Definition Classes
    RequestHeader
  14. def copy(id: Long = this.id, tags: Map[String, String] = this.tags, uri: String = this.uri, path: String = this.path, method: String = this.method, version: String = this.version, queryString: Map[String, Seq[String]] = this.queryString, headers: Headers = this.headers, remoteAddress: ⇒ String = this.remoteAddress, secure: ⇒ Boolean = this.secure): RequestHeader

    Copy the request.

    Copy the request.

    Definition Classes
    RequestHeader
  15. lazy val domain: String

    The HTTP domain

    The HTTP domain

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

    Definition Classes
    AnyRef
  17. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. 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
  19. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  20. def getMethod: String

    Returns the current method

  21. def getQueryString(key: String): Option[String]

    Helper method to access a queryString parameter.

    Helper method to access a queryString parameter.

    Definition Classes
    RequestHeader
  22. val headers: Headers

    The request HTTP headers.

    The request HTTP headers.

    Definition Classes
    FakeRequestRequestHeader
  23. lazy val host: String

    The HTTP host (domain, optionally port)

    The HTTP host (domain, optionally port)

    Definition Classes
    RequestHeader
  24. val id: Long

    The request ID.

    The request ID.

    Definition Classes
    FakeRequestRequestHeader
  25. final def isInstanceOf[T0]: Boolean

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

    Transform the request body.

    Transform the request body.

    Definition Classes
    Request
  27. lazy val mediaType: Option[MediaType]

    The media type of this request.

    The media type of this request. Same as contentType, except returns a fully parsed media type with parameters.

    Definition Classes
    RequestHeader
  28. val method: String

    The request HTTP method.

    The request HTTP method.

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

    Definition Classes
    AnyRef
  30. final def notify(): Unit

    Definition Classes
    AnyRef
  31. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  32. lazy val path: String

    The request path.

    The request path.

    Definition Classes
    FakeRequestRequestHeader
  33. lazy val queryString: Map[String, Seq[String]]

    The request query String

    The request query String

    Definition Classes
    FakeRequestRequestHeader
  34. lazy val rawQueryString: String

    Returns the raw query string.

    Returns the raw query string.

    Definition Classes
    RequestHeader
  35. val remoteAddress: String

    The client IP.

    The client IP.

    Definition Classes
    FakeRequestRequestHeader
  36. val secure: Boolean

    Is the client using SSL?

    Is the client using SSL?

    Definition Classes
    FakeRequestRequestHeader
  37. 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
  38. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  39. val tags: Map[String, String]

    The request Tags.

    The request Tags.

    Definition Classes
    FakeRequestRequestHeader
  40. def toString(): String

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

    The request uri.

    The request uri.

    Definition Classes
    FakeRequestRequestHeader
  42. val version: String

    The HTTP version.

    The HTTP version.

    Definition Classes
    FakeRequestRequestHeader
  43. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. def withBody[B](body: B): FakeRequest[B]

    Adds a body to the request.

  47. def withCookies(cookies: Cookie*): FakeRequest[A]

    Constructs a new request with additional Cookies.

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

    Constructs a new request with additional Flash.

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

    Set a Form url encoded body to this request.

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

    Constructs a new request with additional headers.

    Constructs a new request with additional headers. Any existing headers of the same name will be replaced.

  51. def withJsonBody(json: JsValue): FakeRequest[AnyContentAsJson]

    Adds a JSON body to the request.

  52. def withMultipartFormDataBody(form: MultipartFormData[TemporaryFile]): FakeRequest[AnyContentAsMultipartFormData]

    Adds a multipart form data body to the request

  53. def withRawBody(bytes: Array[Byte]): FakeRequest[AnyContentAsRaw]

    Adds a raw body to the request

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

    Constructs a new request with additional session.

  55. def withTextBody(text: String): FakeRequest[AnyContentAsText]

    Adds a text body to the request.

  56. def withXmlBody(xml: NodeSeq): FakeRequest[AnyContentAsXml]

    Adds an XML body to the request.

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

Ungrouped