Http

marola.http.Http
object Http

Thin java.net.http.HttpClient wrapper at the Kyo effect boundary, kept deliberately instead of migrating to kyo-http's own client.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Http.type

Members list

Type members

Classlikes

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

Separate from Transport on purpose: every text caller relies on Response.body being decoded as UTF-8 by HttpClient; re-deriving it from bytes would risk corrupting accented responses.

Separate from Transport on purpose: every text caller relies on Response.body being decoded as UTF-8 by HttpClient; re-deriving it from bytes would risk corrupting accented responses.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
final case class BytesResponse(status: Int, bytes: Array[Byte])

What a binary response is — the raw bytes, never decoded as text.

What a binary response is — the raw bytes, never decoded as text.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class HttpBytesError(status: Int, url: String) extends Exception

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
final case class HttpError(status: Int, url: String, bodySnippet: String) extends Exception

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
final case class Response(status: Int, body: String)

What a transport returns — just the two things every caller here reads.

What a transport returns — just the two things every caller here reads.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Transport

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Transport.type
trait Transport

The one seam between marola and the network.

The one seam between marola and the network.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def getBytes(url: String, timeoutSeconds: Long = ...): Array[Byte] < Sync

Binary GET (PDF bulletins, MIP-0031), never text-decoded.

Binary GET (PDF bulletins, MIP-0031), never text-decoded.

Attributes

def getString(url: String, headers: Map[String, String] = ..., retries: Int = ..., backoffMs: Long = ...): String < Sync

headers: e.g. an API key that must not go in the URL.

headers: e.g. an API key that must not go in the URL.

Attributes

def postBytes(url: String, body: Array[Byte], contentType: String = ..., headers: Map[String, String] = ..., timeoutSeconds: Long = ...): String < Sync

Raw-binary POST — for APIs that take the payload (e.g. image bytes) as the body, not JSON.

Raw-binary POST — for APIs that take the payload (e.g. image bytes) as the body, not JSON.

Attributes

def postForm(url: String, form: Map[String, String], timeoutSeconds: Long = ..., retries: Int = ..., backoffMs: Long = ...): String < Sync

application/x-www-form-urlencoded POST — Overpass's query API and Telegram's Bot API both accept this for their respective single-field payloads.

application/x-www-form-urlencoded POST — Overpass's query API and Telegram's Bot API both accept this for their respective single-field payloads.

Attributes

def postJson(url: String, jsonBody: String, headers: Map[String, String] = ..., timeoutSeconds: Long = ...): String < Sync

application/json POST with arbitrary extra headers (e.g. Authorization: Bearer ...) — used by both llm clients.

application/json POST with arbitrary extra headers (e.g. Authorization: Bearer ...) — used by both llm clients.

Attributes

def putBytes(url: String, body: Array[Byte], contentType: String = ..., headers: Map[String, String] = ..., timeoutSeconds: Long = ...): String < Sync

Raw-binary PUT — MLflow's artifact-store proxy (PUT .../mlflow-artifacts/artifacts/).

Raw-binary PUT — MLflow's artifact-store proxy (PUT .../mlflow-artifacts/artifacts/).

Attributes

def withBinaryTransport[A](t: BinaryTransport)(body: => A): A

Test seam for getBytes, mirroring withTransport — replay a fixture PDF/binary by URL.

Test seam for getBytes, mirroring withTransport — replay a fixture PDF/binary by URL.

Attributes

def withTransport[A](t: Transport)(body: => A): A

Test seam: runs body with t installed, restoring the previous transport afterwards.

Test seam: runs body with t installed, restoring the previous transport afterwards.

Attributes

Concrete fields

val RetryableStatuses: Set[Int]

Statuses worth another attempt — a rate limit or an overloaded/absent upstream, never a client error: 429, 502, 503, 504.

Statuses worth another attempt — a rate limit or an overloaded/absent upstream, never a client error: 429, 502, 503, 504.

Attributes