URL

zio.http.URL
See theURL companion object
final case class URL(path: Path, kind: Location = ..., queryParams: QueryParams = ..., fragment: Option[Fragment] = ...) extends URLPlatformSpecific

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait QueryChecks[URL]
trait QueryGetters[URL]
class Object
trait Matchable
class Any
Show all
Self type
URL

Members list

Value members

Concrete methods

def ++(that: URL): URL

A right-biased way of combining two URLs. Where it makes sense, information will be merged, but in cases where this does not make sense (e.g. two non-empty fragments), the information from the right URL will be used.

A right-biased way of combining two URLs. Where it makes sense, information will be merged, but in cases where this does not make sense (e.g. two non-empty fragments), the information from the right URL will be used.

Attributes

def /(segment: String): URL
def absolute(host: String): URL
def absolute(scheme: Scheme, host: String, port: Int): URL
def addPath(path: Path): URL
def addPath(path: String): URL
def addQueryParams(queryParams: QueryParams): URL
def encode: String
override def equals(that: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Value parameters

that

the object to compare against this object for equality.

Attributes

Returns

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
Equals -> Any
override def hashCode(): Int

Calculates a hash code value for the object.

Calculates a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Attributes

Returns

the hash code value for this object.

Definition Classes
Any
def host(host: String): URL

Attributes

Returns

the location, the host name and the port. The port part is omitted if is the default port for the protocol.

def normalize: URL
def path(path: Path): URL
def path(path: String): URL
def port(port: Int): URL
def port: Option[Int]

Attributes

Definition Classes
def relative: URL
def resolve(reference: URL): Either[String, URL]

RFC 3986 § 5.2 Relative Resolution

RFC 3986 § 5.2 Relative Resolution

Value parameters

reference

the URL to resolve relative to this base URL

Attributes

Returns

the target URL

def scheme(scheme: Scheme): URL
def toJavaURI: URI

Returns a new java.net.URI representing this URL.

Returns a new java.net.URI representing this URL.

Attributes

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Attributes

Definition Classes

Inherited methods

def ++(that: QueryParams): URL

Combines two collections of query parameters together. If there are duplicate keys, the values from both sides are preserved, in order from left-to-right.

Combines two collections of query parameters together. If there are duplicate keys, the values from both sides are preserved, in order from left-to-right.

Attributes

Inherited from:
QueryModifier
def addQueryParam[T](value: T)(implicit schema: Schema[T]): URL

Attributes

Inherited from:
QueryModifier
def addQueryParam[T](key: String, value: T)(implicit schema: Schema[T]): URL

Attributes

Inherited from:
QueryModifier
def addQueryParam(key: String): URL

Attributes

Inherited from:
QueryModifier
def addQueryParam(key: String, value: String): URL

Adds the specified key/value pair to the query parameters.

Adds the specified key/value pair to the query parameters.

Attributes

Inherited from:
QueryModifier
def addQueryParams(queryParams: Iterable[(String, String)]): URL

Attributes

Inherited from:
QueryModifier
def addQueryParams(values: String): URL

Attributes

Inherited from:
QueryModifier
def addQueryParams(key: String, value: Chunk[String]): URL

Adds the specified key/value pairs to the query parameters.

Adds the specified key/value pairs to the query parameters.

Attributes

Inherited from:
QueryModifier
def hasQueryParam(name: CharSequence): Boolean

Attributes

Inherited from:
QueryChecks

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
def query[T](implicit schema: Schema[T]): Either[QueryParamError, T]

Retrieves query parameters as a value of the specified type. The type must have a schema and be a case class and all fields must be query parameters. So fields must be of primitive types (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these. Query parameters are selected by field names.

Retrieves query parameters as a value of the specified type. The type must have a schema and be a case class and all fields must be query parameters. So fields must be of primitive types (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these. Query parameters are selected by field names.

Attributes

Inherited from:
QueryGetters
def query[T](key: String)(implicit schema: Schema[T]): Either[QueryParamError, T]

Retrieves the query parameter with the specified name as a value of the specified type. The type must have a schema and can be a primitive type (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these.

Retrieves the query parameter with the specified name as a value of the specified type. The type must have a schema and can be a primitive type (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these.

Attributes

Inherited from:
QueryGetters
def queryOrElse[T](default: => T)(implicit schema: Schema[T]): T

Attributes

Inherited from:
QueryGetters
def queryOrElse[T](key: String, default: => T)(implicit schema: Schema[T]): T

Attributes

Inherited from:
QueryGetters

Retrieves the first query parameter value having the specified name.

Retrieves the first query parameter value having the specified name.

Attributes

Inherited from:
QueryGetters
def queryParamOrElse(key: String, default: => String): String

Retrieves the first query parameter value having the specified name, or else uses the default value.

Retrieves the first query parameter value having the specified name, or else uses the default value.

Attributes

Inherited from:
QueryGetters

Retrieves all query parameter values having the specified name.

Retrieves all query parameter values having the specified name.

Attributes

Inherited from:
QueryGetters
def queryParamsOrElse(key: String, default: => Iterable[String]): Chunk[String]

Retrieves all query parameter values having the specified name, or else uses the default iterable.

Retrieves all query parameter values having the specified name, or else uses the default iterable.

Attributes

Inherited from:
QueryGetters
def queryZIO[T](key: String)(implicit schema: Schema[T]): IO[QueryParamError, T]

Retrieves all typed query parameter values having the specified name as ZIO

Retrieves all typed query parameter values having the specified name as ZIO

Attributes

Inherited from:
QueryGetters

Removes the specified key from the query parameters.

Removes the specified key from the query parameters.

Attributes

Inherited from:
QueryModifier

Removes the specified keys from the query parameters.

Removes the specified keys from the query parameters.

Attributes

Inherited from:
QueryModifier
def setQueryParams(queryParams: (String, Chunk[String])*): URL

Attributes

Inherited from:
QueryModifier
def setQueryParams(queryParams: Map[String, Chunk[String]]): URL

Attributes

Inherited from:
QueryModifier
def setQueryParams(values: String): URL

Attributes

Inherited from:
QueryModifier

Attributes

Inherited from:
QueryModifier
def toJavaURL: Option[URL]

Returns a new java.net.URL only if this URL represents an absolute location.

Returns a new java.net.URL only if this URL represents an absolute location.

Attributes

Inherited from:
URLPlatformSpecific
def valueCount(name: CharSequence): Int

Attributes

Inherited from:
QueryChecks

Deprecated and Inherited methods

def queryParamTo[T](key: String)(implicit codec: TextCodec[T]): Either[QueryParamsError, T]

Retrieves the first typed query parameter value having the specified name.

Retrieves the first typed query parameter value having the specified name.

Attributes

Deprecated
[Since version 3.1.0] Use query(key)[T]
Inherited from:
QueryGetters
def queryParamToOrElse[T](key: String, default: => T)(implicit codec: TextCodec[T]): T

Retrieves the first typed query parameter value having the specified name, or else uses the default value.

Retrieves the first typed query parameter value having the specified name, or else uses the default value.

Attributes

Deprecated
[Since version 3.1.0] Use queryParamOrElse(key, default)
Inherited from:
QueryGetters
def queryParamToZIO[T](key: String)(implicit codec: TextCodec[T]): IO[QueryParamsError, T]

Retrieves the first typed query parameter value having the specified name as ZIO.

Retrieves the first typed query parameter value having the specified name as ZIO.

Attributes

Deprecated
[Since version 3.1.0] Use queryZIO(key)[T]
Inherited from:
QueryGetters
def queryParamsTo[T](key: String)(implicit codec: TextCodec[T]): Either[QueryParamsError, Chunk[T]]

Retrieves all typed query parameter values having the specified name.

Retrieves all typed query parameter values having the specified name.

Attributes

Deprecated
[Since version 3.1.0] Use query(key)[Chunk[T]
Inherited from:
QueryGetters
def queryParamsToOrElse[T](key: String, default: => Iterable[T])(implicit codec: TextCodec[T]): Chunk[T]

Retrieves all query parameter values having the specified name, or else uses the default iterable.

Retrieves all query parameter values having the specified name, or else uses the default iterable.

Attributes

Deprecated
[Since version 3.1.0] Use queryParamsOrElse(key, default)
Inherited from:
QueryGetters
def queryParamsToZIO[T](key: String)(implicit codec: TextCodec[T]): IO[QueryParamsError, Chunk[T]]

Retrieves all typed query parameter values having the specified name as ZIO.

Retrieves all typed query parameter values having the specified name as ZIO.

Attributes

Deprecated
[Since version 3.1.0] Use queryZIO(key)[Chunk[T]
Inherited from:
QueryGetters