package ahc
- Alphabetic
- Public
- Protected
Type Members
- class AhcConfigBuilder extends AnyRef
Builds a valid AsyncHttpClientConfig object from config.
- class AhcCurlRequestLogger extends WSRequestFilter with CurlFormat
Logs StandaloneWSRequest and pulls information into Curl format to an SLF4J logger.
Logs StandaloneWSRequest and pulls information into Curl format to an SLF4J logger.
- See also
- class AhcLoggerFactory extends LoggerFactory
- trait AhcUtilities extends AnyRef
Useful mapping code.
- case class AhcWSClientConfig(wsClientConfig: WSClientConfig = WSClientConfig(), maxConnectionsPerHost: Int = -1, maxConnectionsTotal: Int = -1, maxConnectionLifetime: Duration = Duration.Inf, idleConnectionInPoolTimeout: Duration = 1.minute, connectionPoolCleanerPeriod: Duration = 1.second, maxNumberOfRedirects: Int = 5, maxRequestRetry: Int = 5, disableUrlEncoding: Boolean = false, keepAlive: Boolean = true, useLaxCookieEncoder: Boolean = false, useCookieStore: Boolean = false) extends Product with Serializable
Ahc client config.
Ahc client config.
- wsClientConfig
The general WS client config.
- maxConnectionsPerHost
The maximum number of connections to make per host. -1 means no maximum.
- maxConnectionsTotal
The maximum total number of connections. -1 means no maximum.
- maxConnectionLifetime
The maximum time that a connection should live for in the pool.
- idleConnectionInPoolTimeout
The time after which a connection that has been idle in the pool should be closed.
- connectionPoolCleanerPeriod
the frequency to cleanup timeout idle connections
- maxNumberOfRedirects
The maximum number of redirects.
- maxRequestRetry
The maximum number of times to retry a request if it fails.
- disableUrlEncoding
Whether the raw URL should be used.
- keepAlive
keeps thread pool active, replaces allowPoolingConnection and allowSslConnectionPool
- useLaxCookieEncoder
whether to use LAX(no cookie name/value verification) or STRICT (verifies cookie name/value) cookie decoder
- class AhcWSClientConfigParser extends Provider[AhcWSClientConfig]
This class creates a AhcWSClientConfig object from configuration.
This class creates a AhcWSClientConfig object from configuration.
- Annotations
- @Singleton()
- trait CookieBuilder extends WSCookieConverter
- trait CurlFormat extends AnyRef
- class DefaultStreamedAsyncHandler[T] extends StreamedAsyncHandler[Unit] with AhcUtilities
- class StandaloneAhcWSClient extends StandaloneWSClient
A WS client backed by an AsyncHttpClient.
A WS client backed by an AsyncHttpClient.
If you need to debug AsyncHttpClient, add <logger name="play.shaded.ahc.org.asynchttpclient" level="DEBUG" /> into your conf/logback.xml file.
- case class StandaloneAhcWSRequest(client: StandaloneAhcWSClient, url: String, method: String = "GET", body: WSBody = EmptyBody, headers: Map[String, Seq[String]] = TreeMap()(CaseInsensitiveOrdered), queryString: Map[String, Seq[String]] = Map.empty, cookies: Seq[WSCookie] = Seq.empty, calc: Option[WSSignatureCalculator] = None, auth: Option[(String, String, WSAuthScheme)] = None, followRedirects: Option[Boolean] = None, requestTimeout: Option[Duration] = None, virtualHost: Option[String] = None, proxyServer: Option[WSProxyServer] = None, disableUrlEncoding: Option[Boolean] = None, filters: Seq[WSRequestFilter] = Nil)(implicit materializer: Materializer) extends StandaloneWSRequest with AhcUtilities with WSCookieConverter with Product with Serializable
A Ahc WS Request.
- class StandaloneAhcWSResponse extends StandaloneWSResponse with DefaultBodyReadables with WSCookieConverter with AhcUtilities
A WS HTTP response backed by org.asynchttpclient.Response.
- class StreamedResponse extends StandaloneWSResponse with CookieBuilder
A streamed response containing a response header and a streamable body.
A streamed response containing a response header and a streamable body.
Note that this is only usable with a stream call, i.e.
import scala.concurrent.{ ExecutionContext, Future } import org.apache.pekko.util.ByteString import org.apache.pekko.stream.scaladsl.Source import play.api.libs.ws.DefaultBodyReadables._ import play.api.libs.ws.ahc.StandaloneAhcWSClient class MyClass(ws: StandaloneAhcWSClient) { def doIt(implicit ec: ExecutionContext): Future[String] = ws.url("http://example.com").stream().map { response => val _ = response.body[Source[ByteString, _]] ??? // process source to String } }
- case class StreamedState(statusCode: Int = -1, statusText: String = "", uriOption: Option[URI] = None, responseHeaders: Map[String, Seq[String]] = Map.empty, publisher: Publisher[HttpResponseBodyPart] = EmptyPublisher) extends Product with Serializable
- trait WSCookieConverter extends AnyRef
Converts between AHC cookie and the WS cookie.
Value Members
- object AhcCurlRequestLogger
- object AhcWSClientConfigFactory
Factory for creating AhcWSClientConfig, for use from Java.
- object StandaloneAhcWSClient
- object StandaloneAhcWSResponse