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) Build one with HttpResponse.apply and change it with the
with*setters; the constructor andcopyare private, so a new field never breaks callers. - statusCode
-
HTTP status code (e.g. 200, 404)
Attributes
- Companion
- object
- Source
- Llm4sHttpClient.scala
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
The response when its status is 2xx, else a ServiceError carrying the status and the body. The body in the error is redacted and capped (Redaction.safeBody, 2048 characters), since a provider's error body can echo the request's credentials. The error also carries the response's request id (x-request-id, request-id, x-amzn-requestid or apim-request-id) and its Retry-After delay (delta-seconds or an HTTP-date), when it sent them.
The response when its status is 2xx, else a ServiceError carrying the status and the body. The body in the error is redacted and capped (Redaction.safeBody, 2048 characters), since a provider's error body can echo the request's credentials. The error also carries the response's request id (x-request-id, request-id, x-amzn-requestid or apim-request-id) and its Retry-After delay (delta-seconds or an HTTP-date), when it sent them.
Attributes
- Source
- Llm4sHttpClient.scala
First value of header name, matched case-insensitively.
Attributes
- Source
- Llm4sHttpClient.scala
This response as Llm4sHttpClient.send returns one, its body the UTF-8 bytes of body: what a test double's send answers with.
This response as Llm4sHttpClient.send returns one, its body the UTF-8 bytes of body: what a test double's send answers with.
Attributes
- Source
- Llm4sHttpClient.scala
Sets the response body.
Sets the response headers (a multi-valued map with lowercase keys).
Sets the response headers (a multi-valued map with lowercase keys).
Attributes
- Source
- Llm4sHttpClient.scala
Sets the HTTP status code.
