The two timeouts bound different waits, and neither is a deadline for the whole exchange:
responseTimeout is the longest wait, from sending the request, for the response's status line and headers. It covers connecting too, unless the client was created with a shorter connect timeout.
idleTimeout is the longest a read of the response body waits for more bytes. It is not measured while the caller is busy between reads, so a slow consumer never trips it, and a stream that keeps delivering may run for any length of time.
Build one with HttpRequest.apply and change it with the with* setters; the constructor and copy are private, so a new field never breaks callers. toString leaves the headers and query out, since either may carry a credential.
Value parameters
body
the request body
headers
request headers, single-valued
idleTimeout
the longest a read of the response body waits for more bytes
method
the HTTP method
queryParams
query parameters, URL-encoded and appended to url by fullUrl
responseTimeout
the longest wait for the response's status line and headers
url
absolute http or https URL; queryParams are appended to it
This request with a HttpBody.Multipart body encoded: the body becomes HttpBody.Bytes and Content-Type names the boundary. Field and file names are escaped (", CR and LF percent-encoded) and files are read here, so a file that cannot be read, or a part content type holding a line break, is a Left(ValidationError). A request with any other body is returned unchanged.
This request with a HttpBody.Multipart body encoded: the body becomes HttpBody.Bytes and Content-Type names the boundary. Field and file names are escaped (", CR and LF percent-encoded) and files are read here, so a file that cannot be read, or a part content type holding a line break, is a Left(ValidationError). A request with any other body is returned unchanged.
For an Llm4sHttpClient whose transport has no multipart support of its own.