Package org.apache.juneau.rest.client
Class TransportRequest.Builder
java.lang.Object
org.apache.juneau.rest.client.TransportRequest.Builder
- Enclosing class:
- TransportRequest
Fluent builder for
TransportRequest.- Since:
- 9.2.1
-
Method Summary
Modifier and TypeMethodDescriptionSets the per-client special-purpose address ranges the SSRF guardrail re-permits for this request.body(TransportBody value) Sets the request body.build()Builds and returns theTransportRequest.Appends a request header.headers(Collection<TransportHeader> value) Appends multiple request headers.Sets the HTTP method.remoteUrlPolicy(boolean policyEnforced, boolean allowPrivateUrls) Marks this request as originating from a@Remote/@Urlcall, subject to the SSRF guardrail, and records whether theallowPrivateUrlsopt-in is in effect.Sets the per-call response timeout.Sets the request URI from a string.Sets the request URI.
-
Method Details
-
method
Sets the HTTP method.- Parameters:
value- The method (e.g."GET"). Must not benull .- Returns:
- This object.
-
uri
Sets the request URI.- Parameters:
value- The URI. Must not benull .- Returns:
- This object.
-
uri
Sets the request URI from a string.- Parameters:
value- The URI string. Must not benull .- Returns:
- This object.
- Throws:
IllegalArgumentException- If the string is not a valid URI.
-
header
Appends a request header.- Parameters:
name- The header name. Must not benull .value- The header value. Must not benull .- Returns:
- This object.
-
headers
Appends multiple request headers.- Parameters:
value- The headers to add. Must not benull .- Returns:
- This object.
-
body
Sets the request body.- Parameters:
value- The body. May benull for body-less requests.- Returns:
- This object.
-
timeout
Sets the per-call response timeout.- Parameters:
value- The response timeout. May benull to use the transport default. Must otherwise be positive.- Returns:
- This object.
- Throws:
IllegalArgumentException- Ifvalue is zero or negative.
-
remoteUrlPolicy
Marks this request as originating from a@Remote/@Urlcall, subject to the SSRF guardrail, and records whether theallowPrivateUrlsopt-in is in effect.- Parameters:
policyEnforced-trueif this request is policy-covered.allowPrivateUrls-trueif theallowPrivateUrlsopt-in disables the deny-private checks.- Returns:
- This object.
-
allowedAddressRanges
Sets the per-client special-purpose address ranges the SSRF guardrail re-permits for this request.- Parameters:
value- The allowed ranges.null means none.- Returns:
- This object.
-
build
Builds and returns theTransportRequest.- Returns:
- A new instance. Never
null .
-