org.llm4s.http
Members list
Type members
Classlikes
Case-insensitive lookup over a multi-valued header map, as carried by every response type in this package.
Case-insensitive lookup over a multi-valued header map, as carried by every response type in this package.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
HttpHeaders.type
HTTP response wrapper for binary (non-text) response bodies.
HTTP response wrapper for binary (non-text) response bodies.
Use this instead of HttpResponse when the response body is binary data (e.g. image bytes) to avoid lossy charset decoding.
Value parameters
- body
-
Raw response bytes — exact wire representation, no charset conversion
- headers
-
Response headers as a multi-valued map (lowercase keys)
- statusCode
-
HTTP status code
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
HTTP response wrapper exposing status code, body, and headers.
HTTP response wrapper exposing status code, body, and headers.
Value parameters
- body
-
Response body as a string
- headers
-
Response headers as a multi-valued map (lowercase keys)
- statusCode
-
HTTP status code (e.g. 200, 404)
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
HttpResponse.type
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
The HTTP client provider modules and built-in tools use, abstracted so it can be injected and replaced by a test double.
The HTTP client provider modules and built-in tools use, abstracted so it can be injected and replaced by a test double.
Every request method returns a Result and never throws for a transport failure:
- a request that times out is a
Left(org.llm4s.error.TimeoutError); - a connection failure, unknown host or other I/O error is a
Left(org.llm4s.error.NetworkError); - an invalid URL, header or timeout, or an unreadable multipart file, is a
Left(org.llm4s.error.ValidationError); - an interrupted request, or a stream read interrupted mid-body, is a
Left(org.llm4s.error.CancelledError), with the thread's interrupt flag kept.
A non-2xx status is '''not''' an error at this layer: it is a Right response, which the caller inspects (HttpResponse.ensureSuccess, or org.llm4s.llmconnect.provider.HttpErrorMapper.mapHttpError with the response headers).
Headers are passed as single-valued maps. Response headers are multi-valued, keyed in lower case; look one up with header(name).
The trait is deliberately not sealed, so tests can implement it. Methods added to it after 1.0 will have default implementations, so a test double keeps compiling.
Attributes
- Companion
- object
- Supertypes
-
trait AutoCloseableclass Objecttrait Matchableclass Any
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Llm4sHttpClient.type
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
MultipartPart.type
HTTP response wrapper for streaming (InputStream-based) response bodies.
HTTP response wrapper for streaming (InputStream-based) response bodies.
Use this instead of HttpResponse when the response body must be consumed incrementally (e.g. server-sent events, JSON lines).
Value parameters
- body
-
Response body as an InputStream — caller is responsible for closing it, on error statuses too
- headers
-
Response headers as a multi-valued map (lowercase keys)
- statusCode
-
HTTP status code
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all