Class/Object

com.markfeeney.circlet

Request

Related Docs: object Request | package circlet

Permalink

case class Request(serverPort: Int, serverName: String, remoteAddr: String, uri: String, queryString: Option[String] = None, scheme: Scheme = Scheme.Http, requestMethod: HttpMethod = HttpMethod.Get, protocol: String = "HTTP/1.1", sslClientCert: Option[X509Certificate] = None, headers: Map[String, String] = Map.empty, body: Option[InputStream] = None, attrs: Map[String, AnyRef] = Map.empty) extends Product with Serializable

Basic request. Modeled after Request Map in https://github.com/ring-clojure/ring/blob/master/SPEC

serverPort

The port on which the request is being handled.

serverName

The resolved server name, or the server IP address.

remoteAddr

The IP address of the client or the last proxy that sent the request.

uri

The request URI, excluding the query string and the "?" separator. Must start with "/".

queryString

The query string, if present.

scheme

The transport protocol.

requestMethod

The transport protocol.

protocol

The protocol the request was made with, e.g. "HTTP/1.1"

sslClientCert

The SSL client certificate, if supplied.

headers

A map of lowercased header names to corresponding values.

body

The request body, if present.

attrs

Other info tacked on to the request.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Request
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Request(serverPort: Int, serverName: String, remoteAddr: String, uri: String, queryString: Option[String] = None, scheme: Scheme = Scheme.Http, requestMethod: HttpMethod = HttpMethod.Get, protocol: String = "HTTP/1.1", sslClientCert: Option[X509Certificate] = None, headers: Map[String, String] = Map.empty, body: Option[InputStream] = None, attrs: Map[String, AnyRef] = Map.empty)

    Permalink

    serverPort

    The port on which the request is being handled.

    serverName

    The resolved server name, or the server IP address.

    remoteAddr

    The IP address of the client or the last proxy that sent the request.

    uri

    The request URI, excluding the query string and the "?" separator. Must start with "/".

    queryString

    The query string, if present.

    scheme

    The transport protocol.

    requestMethod

    The transport protocol.

    protocol

    The protocol the request was made with, e.g. "HTTP/1.1"

    sslClientCert

    The SSL client certificate, if supplied.

    headers

    A map of lowercased header names to corresponding values.

    body

    The request body, if present.

    attrs

    Other info tacked on to the request.

Value Members

  1. final def !=(arg0: Any): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addHeader(name: String, value: String): Request

    Permalink

    Helper to add a header to this Request.

    Helper to add a header to this Request. Returns a new Request containing a header with name/value. NB: the header name is converted to lowercase before being stored.

    name

    Name of the header to add, e.g. "Content-type".

    value

    Value of the header, e.g. "text/html"

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. val attrs: Map[String, AnyRef]

    Permalink

    Other info tacked on to the request.

  7. val body: Option[InputStream]

    Permalink

    The request body, if present.

  8. def bodyString(encoding: Charset = StandardCharsets.UTF_8): Option[String]

    Permalink

    Helper to convert body into a String.

    Helper to convert body into a String. Beware using it on huge bodies.

  9. def characterEncoding: Option[Charset]

    Permalink

    Get the Charset of the request, if any.

    Get the Charset of the request, if any. Looks in the Content-Type header. Requests may actually have a Content-Type header for POSTs and PUTs.

  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def contentLength: Option[Long]

    Permalink

    Helper to get content length since it is so commonly used.

  12. def contentType: Option[String]

    Permalink

    Helper to get content type since it is so commonly used.

  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  16. def getHeader(name: String): Option[String]

    Permalink

    Helper to get a header from the request.

  17. val headers: Map[String, String]

    Permalink

    A map of lowercased header names to corresponding values.

  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. val protocol: String

    Permalink

    The protocol the request was made with, e.g.

    The protocol the request was made with, e.g. "HTTP/1.1"

  23. val queryString: Option[String]

    Permalink

    The query string, if present.

  24. val remoteAddr: String

    Permalink

    The IP address of the client or the last proxy that sent the request.

  25. val requestMethod: HttpMethod

    Permalink

    The transport protocol.

  26. val scheme: Scheme

    Permalink

    The transport protocol.

  27. val serverName: String

    Permalink

    The resolved server name, or the server IP address.

  28. val serverPort: Int

    Permalink

    The port on which the request is being handled.

  29. def setContentLength(value: Long): Request

    Permalink

    Helper to set content length since it is so commonly used.

    Helper to set content length since it is so commonly used. Returns new Request.

  30. def setContentType(value: String): Request

    Permalink

    Helper to set content type since it is so commonly used.

    Helper to set content type since it is so commonly used. Returns new Request.

  31. val sslClientCert: Option[X509Certificate]

    Permalink

    The SSL client certificate, if supplied.

  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  33. def updated(key: String, value: AnyRef): Request

    Permalink

    Helper for easily adding things to the attrs map.

    Helper for easily adding things to the attrs map.

    key

    Name of the thing to add

    value

    The thing to add

    returns

    A new HttpRequest with key/value added to attrs.

  34. val uri: String

    Permalink

    The request URI, excluding the query string and the "?" separator.

    The request URI, excluding the query string and the "?" separator. Must start with "/".

  35. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped