case class SimpleHttpClient(backend: SttpBackend[Identity, Any]) extends Product with Serializable
A simple, synchronous http client. Usage example:
import sttp.client3.{SimpleHttpClient, UriContext, basicRequest} val client = SimpleHttpClient() val request = basicRequest.get(uri"https://httpbin.org/get") val response = client.send(request) println(response.body)
Wraps an SttpBackend, which can be substituted or modified using wrapBackend, adding e.g. logging.
Creating a client allocates resources, hence when no longer needed, the client should be closed using close.
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- SimpleHttpClient
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Instance Constructors
- new SimpleHttpClient(backend: SttpBackend[Identity, Any])
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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val backend: SttpBackend[Identity, Any]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- def close(): Unit
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def send[T](request: Request[T, Any]): Response[T]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withBackend(newBackend: SttpBackend[Identity, Any]): SimpleHttpClient
- def wrapBackend(f: (SttpBackend[Identity, Any]) => SttpBackend[Identity, Any]): SimpleHttpClient
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)