case class Request(method: HttpMethod, url: String = "/", scheme: String = "http", content: Content = Content.empty, headers: Map[HttpString, HttpString] = Map.empty, protocol: String = HTTP, from: Option[InetAddress] = None) extends Product with Serializable
An HTTP request.
Represent all the data available in the HTTP request headers, and the request content that can be consumed lazily if needed.
- method
the HTTP method such as GET or POST.
- url
the resource URL.
- scheme
the scheme such as
http
orhttps
.- content
the request content.
- headers
the HTTP headers.
- protocol
the protocol version.
- Source
- Request.scala
- Alphabetic
- By Inheritance
- Request
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
Request(method: HttpMethod, url: String = "/", scheme: String = "http", content: Content = Content.empty, headers: Map[HttpString, HttpString] = Map.empty, protocol: String = HTTP, from: Option[InetAddress] = None)
- method
the HTTP method such as GET or POST.
- url
the resource URL.
- scheme
the scheme such as
http
orhttps
.- content
the request content.
- headers
the HTTP headers.
- protocol
the protocol version.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addHeaders(headers: (HttpString, HttpString)*): Request
Add some headers to this request.
Add some headers to this request.
- headers
the new headers to add.
- returns
a copy of the request with the new headers added.
-
def
addHeaders(headers: Map[HttpString, HttpString]): Request
Add some headers to this request.
Add some headers to this request.
- headers
the new headers to add.
- returns
a copy of the request with the new headers added.
-
def
apply[A](content: A)(implicit encoder: ContentEncoder[A]): Request
Set the content of this request.
Set the content of this request.
- content
the content to use for this request.
- encoder
the ContentEncoder to use to encode this content.
- returns
a copy of this request with a new content.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- val content: Content
-
def
drain: IO[Unit]
Drain the content attached to this request.
Drain the content attached to this request. It is safe to call this operation even if the stream has already been consumed.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- val from: Option[InetAddress]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val headers: Map[HttpString, HttpString]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val method: HttpMethod
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
lazy val
parsedQueryString: List[(String, String)]
The queryString parsed as a sequence of key=value parameters.
-
lazy val
path: String
The path part of the URL (ie.
The path part of the URL (ie. without the queryString).
- val protocol: String
-
lazy val
queryString: Option[String]
The queryString part of the URL.
-
lazy val
queryStringParameters: Map[String, String]
The queryString parameters.
The queryString parameters. Duplicated parameters are ignored, only the first value is available.
-
def
read[A](effect: (Stream[IO, Byte]) ⇒ IO[A]): IO[A]
Consume the content attached to this request by evaluating the provided effect function.
Consume the content attached to this request by evaluating the provided effect function.
- effect
the function to use to consume the stream.
- returns
eventually a value of type
A
.
-
def
readAs[A](implicit decoder: ContentDecoder[A]): IO[A]
Consume the content attached to this request and eventually produces a value of type
A
.Consume the content attached to this request and eventually produces a value of type
A
.- decoder
the ContentDecoder to use to read the content.
- returns
eventually a value of type
A
.
-
def
removeHeaders(headerNames: HttpString*): Request
Remove some headers from this request.
Remove some headers from this request.
- headerNames
the header names to remove
- returns
a copy of the request without the removed headers.
- val scheme: String
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- val url: String
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )