package http
- Source
- http.scala
- Alphabetic
- By Inheritance
- http
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- trait HttpClient [F[_]] extends AnyRef
-
final
case class
HttpRequest
[F[_]](scheme: Scheme, host: HostPort, header: HttpRequestHeader, body: Stream[F, Byte]) extends HttpRequestOrResponse[F] with Product with Serializable
Model of Http Request sent by client.
Model of Http Request sent by client.
- host
Host/port where to perform the request to
- header
Header of the request
- body
Body of the request. If empty, no body will be emitted.
-
sealed
trait
HttpRequestOrResponse
[F[_]] extends AnyRef
common request/response methods *
-
final
case class
HttpResponse
[F[_]](header: HttpResponseHeader, body: Stream[F, Byte]) extends HttpRequestOrResponse[F] with Product with Serializable
Model of Http Response
Model of Http Response
- header
Header of the response
- body
Body of the response. If empty, no body will be emitted.
Value Members
-
def
client[F[_]](requestCodec: Codec[HttpRequestHeader] = HttpRequestHeaderCodec.defaultCodec, responseCodec: Codec[HttpResponseHeader] = ..., sslStrategy: ⇒ Strategy = ..., sslContext: ⇒ SSLContext = ...)(implicit AG: AsynchronousChannelGroup, F: Async[F]): F[HttpClient[F]]
Creates a client that can be used to make http requests to servers
Creates a client that can be used to make http requests to servers
- requestCodec
Codec used to decode request header
- responseCodec
Codec used to encode response header
- sslStrategy
Strategy used to perform blocking SSL operations
-
def
server[F[_]](bindTo: InetSocketAddress, maxConcurrent: Int = Int.MaxValue, receiveBufferSize: Int = 256 * 1024, maxHeaderSize: Int = 10 *1024, requestHeaderReceiveTimeout: Duration = 5.seconds, requestCodec: Codec[HttpRequestHeader] = HttpRequestHeaderCodec.defaultCodec, responseCodec: Codec[HttpResponseHeader] = ..., requestFailure: (Throwable) ⇒ Stream[F, HttpResponse[F]] = ..., sendFailure: (Option[HttpRequestHeader], HttpResponse[F], Throwable) ⇒ Stream[F, Nothing] = HttpServer.handleSendFailure[F])(service: (HttpRequestHeader, Stream[F, Byte]) ⇒ Stream[F, HttpResponse[F]])(implicit AG: AsynchronousChannelGroup, F: Async[F]): Stream[F, Unit]
Creates simple http server,
Creates simple http server,
Serve will run after the resulting stream is run.
- bindTo
Address and port where to bind server to
- maxConcurrent
Maximum requests to process concurrently
- receiveBufferSize
Receive buffer size for each connection
- maxHeaderSize
Maximum size of http header for incoming requests, in bytes
- requestHeaderReceiveTimeout
A timeout to await request header to be fully received. Request will fail, if the header won't be read within this timeout.
- requestCodec
Codec for Http Request Header
- service
Pipe that defines handling of each incoming request and produces a response
- object HttpClient
- object HttpRequest extends Serializable
- object HttpResponse extends Serializable
- object HttpServer