All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sttp.client.RequestMetadata.scala Maven / Gradle / Ivy

package sttp.client

import sttp.model.{HasHeaders, Header, Method, Uri}

import scala.collection.immutable.Seq

trait RequestMetadata extends HasHeaders {
  def method: Method
  def uri: Uri

  override def toString: String = s"RequestMetadata($method,$uri,${headers.map(_.toStringSafe())})"
}

object RequestMetadata {

  /**
    * Mainly useful in tests using [[sttp.client.testing.SttpBackendStub]], when creating stub responses.
    */
  val ExampleGet: RequestMetadata = new RequestMetadata {
    override def method: Method = Method.GET
    override def uri: Uri = uri"http://example.com"
    override def headers: Seq[Header] = Nil
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy