Class WebRequest.Builder
java.lang.Object
io.fluxzero.sdk.web.WebRequest.Builder
- Enclosing class:
WebRequest
Fluent builder for
WebRequest. Use WebRequest.builder() to start building.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the request body through the payload builder method and returns this builder.build()Builds the request.clearHeader(String key) Removes all values for the header and returns this builder.contentType(String contentType) Appends aContent-Typeheader and returns this builder.cookie(HttpCookie cookie) Adds a request cookie, first parsing any stored Cookie headers, and returns this builder.cookies()Returns the builder's mutable cookie list after moving any stored Cookie header values into parsed cookies.Appends a header value and returns this builder.Appends a header value and returns this builder.headerIfAbsent(String key, String value) Adds the header value only when the header has no values, and returns this builder.headers()Assembles request headers, adding the configured gzip acceptance and inferred string or byte-array content type when absent.Replaces values for the supplied header keys with copied lists, retains other headers, and returns this builder.
-
Constructor Details
-
Builder
-
Builder
-
-
Method Details
-
headerIfAbsent
Adds the header value only when the header has no values, and returns this builder. -
header
Appends a header value and returns this builder. -
header
Appends a header value and returns this builder. IfifAbsentis true, existing non-empty values are preserved without appending. -
headers
Replaces values for the supplied header keys with copied lists, retains other headers, and returns this builder. -
clearHeader
Removes all values for the header and returns this builder. -
cookie
Adds a request cookie, first parsing any stored Cookie headers, and returns this builder. -
cookies
Returns the builder's mutable cookie list after moving any stored Cookie header values into parsed cookies. -
contentType
Appends aContent-Typeheader and returns this builder. -
body
Sets the request body through the payload builder method and returns this builder. -
headers
-
build
Builds the request. ThrowsIllegalStateExceptionwhen no HTTP method has been configured.
-