- java.lang.Object
-
- java.net.http.HttpRequest
-
- com.github.mizosoft.methanol.TaggableRequest
-
- com.github.mizosoft.methanol.MutableRequest
-
- All Implemented Interfaces:
HeadersAccumulator<MutableRequest>,TaggableRequest.Builder,java.net.http.HttpRequest.Builder
public final class MutableRequest extends TaggableRequest implements TaggableRequest.Builder, HeadersAccumulator<MutableRequest>
A mutableHttpRequestthat supportstags, relative URIs&setting arbitrary objects as request bodies. This class implementsHttpRequest.Builderfor setting request fields. Querying a field before it's been set will return its default value. InvokingtoImmutableRequest()will return an immutable copy that is independent of this instance.MutableRequestaccepts an arbitrary object as the request body, referred to as the payload. The payload is resolved into aBodyPublisheronly whenone is requested. Resolution is done by this request'sAdapterCodec. Sending the request through aMethanolclient with anAdapterCodecsets the request'sAdapterCodecautomatically if one is not already present. Note that a request with anAdapterCodecoverrides the client'sAdapterCodecboth for encoding the request body and decoding the response body.Additionally, this class allows setting a
URIwithout a host or a scheme or not setting aURIat all. This is for the case when the request is used with aMethanolclient that has a base URL, against which this request's URL is resolved.MutableRequestalso adds some convenience when theHttpRequestis used immediately after creation:
It is recommended, however, to useclient.send( MutableRequest .GET("https://www.google.com/search?q=java") .header("Accept", "text/html"), BodyHandlers.ofString());toImmutableRequest()if the request is stored somewhere before it's sent in order to prevent accidental mutation, especially when the request is sent asynchronously.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.github.mizosoft.methanol.TaggableRequest
TaggableRequest.Builder
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<AdapterCodec>adapterCodec()Returns theAdapterCodecto be used for resolving this request's payload.MutableRequestadapterCodec(AdapterCodec adapterCodec)Set's theAdapterCodecto be used for resolving this request's payload.MutableRequestapply(java.util.function.Consumer<? super MutableRequest> consumer)Calls the given consumer against this request.java.util.Optional<java.net.http.HttpRequest.BodyPublisher>bodyPublisher()TaggableRequestbuild()Returns an immutable copy of this request.MutableRequestcacheControl(CacheControl cacheControl)Sets theCache-Controlheader to the given value.MutableRequestcopy()Returns a copy of this request that is independent of this instance.static MutableRequestcopyOf(java.net.http.HttpRequest other)Returns a newMutableRequestthat is a copy of the given request.static MutableRequestcreate()Returns a newMutableRequest.static MutableRequestcreate(java.lang.String uri)Returns a newMutableRequestwith the given URI and a default GET method.static MutableRequestcreate(java.net.URI uri)Returns a newMutableRequestwith the given URI and a default GET method.MutableRequestDELETE()static MutableRequestDELETE(java.lang.String uri)Returns a newMutableRequestwith the given URI and a DELETE method.static MutableRequestDELETE(java.net.URI uri)Returns a newMutableRequestwith the given URI and a DELETE method.booleanexpectContinue()MutableRequestexpectContinue(boolean enable)MutableRequestGET()static MutableRequestGET(java.lang.String uri)Returns a newMutableRequestwith the given URI and a GET method.static MutableRequestGET(java.net.URI uri)Returns a newMutableRequestwith the given URI and a GET method.MutableRequestHEAD()static MutableRequestHEAD(java.lang.String uri)Returns a newMutableRequestwith the given URI and a HEAD method.static MutableRequestHEAD(java.net.URI uri)Returns a newMutableRequestwith the given URI and a HEAD method.MutableRequestheader(java.lang.String name, java.lang.String value)Adds the given header name-value pair.java.net.http.HttpHeadersheaders()MutableRequestheaders(java.lang.String... headers)Adds each of the given header name-value pairs.MutableRequestheaders(java.net.http.HttpHeaders headers)Adds each of the givenHttpHeaders.<T> MutableRequesthint(java.lang.Class<T> type, T value)Adds the given value to this request'sBodyAdapter.Hints.BodyAdapter.Hintshints()Returns this request'sBodyAdapter.Hints.MutableRequesthints(java.util.function.Consumer<BodyAdapter.Hints.Builder> hintsMutator)Modifies this request'sBodyAdapter.Hintsby mutating aBodyAdapter.Hints.Builder.java.lang.Stringmethod()MutableRequestmethod(java.lang.String method, java.lang.Object payload, MediaType mediaType)Sets the request method and sets the payload to the given value.MutableRequestmethod(java.lang.String method, java.net.http.HttpRequest.BodyPublisher bodyPublisher)<T> MutableRequestmethod(java.lang.String method, T payload, TypeRef<T> typeRef, MediaType mediaType)Sets the request method and sets the payload to the given value with an explicitly specified type.java.util.Optional<com.github.mizosoft.methanol.MimeBody>mimeBody()MutableRequestPATCH(java.lang.Object payload, MediaType mediaType)Sets the request method to PATCH and sets the payload to the given value.static MutableRequestPATCH(java.lang.String uri, java.lang.Object payload, MediaType mediaType)Returns a newMutableRequestwith the given URI and a PATCH method.static MutableRequestPATCH(java.lang.String uri, java.net.http.HttpRequest.BodyPublisher bodyPublisher)Returns a newMutableRequestwith the given URI and a PATCH method.static <T> MutableRequestPATCH(java.lang.String uri, T payload, TypeRef<T> typeRef, MediaType mediaType)Returns a newMutableRequestwith the given URI and a PATCH method.MutableRequestPATCH(java.net.http.HttpRequest.BodyPublisher bodyPublisher)Sets the request method to PATCH and sets the body publisher to the given value.static MutableRequestPATCH(java.net.URI uri, java.lang.Object payload, MediaType mediaType)Returns a newMutableRequestwith the given URI and a PATCH method.static MutableRequestPATCH(java.net.URI uri, java.net.http.HttpRequest.BodyPublisher bodyPublisher)Returns a newMutableRequestwith the given URI and a PATCH method.static <T> MutableRequestPATCH(java.net.URI uri, T payload, TypeRef<T> typeRef, MediaType mediaType)Returns a newMutableRequestwith the given URI and a PATCH method.<T> MutableRequestPATCH(T payload, TypeRef<T> typeRef, MediaType mediaType)Sets the request method to PATCH and sets the payload to the given value with an explicitly specified type.MutableRequestPOST(java.lang.Object payload, MediaType mediaType)Sets the request method to POST and sets the payload to the given value.static MutableRequestPOST(java.lang.String uri, java.lang.Object payload, MediaType mediaType)Returns a newMutableRequestwith the given URI and a POST method.static MutableRequestPOST(java.lang.String uri, java.net.http.HttpRequest.BodyPublisher bodyPublisher)Returns a newMutableRequestwith the given URI and a POST method.static <T> MutableRequestPOST(java.lang.String uri, T payload, TypeRef<T> typeRef, MediaType mediaType)Returns a newMutableRequestwith the given URI and a POST method.MutableRequestPOST(java.net.http.HttpRequest.BodyPublisher bodyPublisher)static MutableRequestPOST(java.net.URI uri, java.lang.Object payload, MediaType mediaType)Returns a newMutableRequestwith the given URI and a POST method.static MutableRequestPOST(java.net.URI uri, java.net.http.HttpRequest.BodyPublisher bodyPublisher)Returns a newMutableRequestwith the given URI and a POST method.static <T> MutableRequestPOST(java.net.URI uri, T payload, TypeRef<T> typeRef, MediaType mediaType)Returns a newMutableRequestwith the given URI and a POST method.<T> MutableRequestPOST(T payload, TypeRef<T> typeRef, MediaType mediaType)Sets the request method to POST and sets the payload to the given value with an explicitly specified type.MutableRequestPUT(java.lang.Object payload, MediaType mediaType)Sets the request method to PUT and sets the payload to the given value.static MutableRequestPUT(java.lang.String uri, java.lang.Object payload, MediaType mediaType)Returns a newMutableRequestwith the given URI and a PUT method.static MutableRequestPUT(java.lang.String uri, java.net.http.HttpRequest.BodyPublisher bodyPublisher)Returns a newMutableRequestwith the given URI and a PUT method.static <T> MutableRequestPUT(java.lang.String uri, T payload, TypeRef<T> typeRef, MediaType mediaType)Returns a newMutableRequestwith the given URI and a PUT method.MutableRequestPUT(java.net.http.HttpRequest.BodyPublisher bodyPublisher)static MutableRequestPUT(java.net.URI uri, java.lang.Object payload, MediaType mediaType)Returns a newMutableRequestwith the given URI and a PUT method.static MutableRequestPUT(java.net.URI uri, java.net.http.HttpRequest.BodyPublisher bodyPublisher)Returns a newMutableRequestwith the given URI and a PUT method.static <T> MutableRequestPUT(java.net.URI uri, T payload, TypeRef<T> typeRef, MediaType mediaType)Returns a newMutableRequestwith the given URI and a PUT method.<T> MutableRequestPUT(T payload, TypeRef<T> typeRef, MediaType mediaType)Sets the request method to PUT and sets the payload to the given value with an explicitly specified type.MutableRequestremoveHeader(java.lang.String name)Removes any header associated with the given name.MutableRequestremoveHeaders()Removes all headers added so far.MutableRequestremoveHeadersIf(java.util.function.BiPredicate<java.lang.String,java.lang.String> filter)Removes all headers matched by the given predicate.MutableRequestremoveTag(TypeRef<?> typeRef)Removes the tag associated with the given type.MutableRequestremoveTag(java.lang.Class<?> type)Removes the tag associated with the given type.MutableRequestsetHeader(java.lang.String name, java.lang.String value)Sets the header represented by the given name to the given value, overwriting the previous value (if any).MutableRequestsetHeader(java.lang.String name, java.util.List<java.lang.String> values)Sets the header represented by the given name to the given values, overwriting the previous value (if any).MutableRequestsetHeaderIfAbsent(java.lang.String name, java.lang.String value)Sets the header represented by the given name to the given value, only if there was no header with the given name.MutableRequestsetHeaderIfAbsent(java.lang.String name, java.util.List<java.lang.String> values)Sets the header represented by the given name to the given values, only if there was no header with the given name.<T> MutableRequesttag(TypeRef<T> typeRef, T value)Adds a tag mapped to the given type.<T> MutableRequesttag(java.lang.Class<T> type, T value)Adds a tag mapped to the given type.MutableRequesttag(java.lang.Object value)Adds a tag mapped to the given object's runtime type.java.util.Optional<java.time.Duration>timeout()MutableRequesttimeout(java.time.Duration timeout)TaggableRequesttoImmutableRequest()Returns an immutable copy of this request.java.lang.StringtoString()java.net.URIuri()MutableRequesturi(java.lang.String uri)Sets this request'sURI.MutableRequesturi(java.net.URI uri)Sets this request'sURI.java.util.Optional<java.net.http.HttpClient.Version>version()MutableRequestversion(java.net.http.HttpClient.Version version)
-
-
-
Method Detail
-
uri
@CanIgnoreReturnValue public MutableRequest uri(java.lang.String uri)
Sets this request'sURI. Can be relative or without a host or a scheme.- Throws:
java.lang.IllegalArgumentException- if the uri's syntax is invalid
-
cacheControl
@CanIgnoreReturnValue public MutableRequest cacheControl(CacheControl cacheControl)
Sets theCache-Controlheader to the given value.
-
apply
@CanIgnoreReturnValue public MutableRequest apply(java.util.function.Consumer<? super MutableRequest> consumer)
Calls the given consumer against this request.
-
tag
@CanIgnoreReturnValue public MutableRequest tag(java.lang.Object value)
Description copied from interface:TaggableRequest.BuilderAdds a tag mapped to the given object's runtime type.- Specified by:
tagin interfaceTaggableRequest.Builder
-
tag
@CanIgnoreReturnValue public <T> MutableRequest tag(java.lang.Class<T> type, T value)
Description copied from interface:TaggableRequest.BuilderAdds a tag mapped to the given type.- Specified by:
tagin interfaceTaggableRequest.Builder
-
tag
@CanIgnoreReturnValue public <T> MutableRequest tag(TypeRef<T> typeRef, T value)
Description copied from interface:TaggableRequest.BuilderAdds a tag mapped to the given type.- Specified by:
tagin interfaceTaggableRequest.Builder
-
removeTag
@CanIgnoreReturnValue public MutableRequest removeTag(java.lang.Class<?> type)
Description copied from interface:TaggableRequest.BuilderRemoves the tag associated with the given type.- Specified by:
removeTagin interfaceTaggableRequest.Builder
-
removeTag
@CanIgnoreReturnValue public MutableRequest removeTag(TypeRef<?> typeRef)
Description copied from interface:TaggableRequest.BuilderRemoves the tag associated with the given type.- Specified by:
removeTagin interfaceTaggableRequest.Builder
-
hints
public MutableRequest hints(java.util.function.Consumer<BodyAdapter.Hints.Builder> hintsMutator)
Modifies this request'sBodyAdapter.Hintsby mutating aBodyAdapter.Hints.Builder.
-
hint
public <T> MutableRequest hint(java.lang.Class<T> type, T value)
Adds the given value to this request'sBodyAdapter.Hints.
-
bodyPublisher
public java.util.Optional<java.net.http.HttpRequest.BodyPublisher> bodyPublisher()
- Specified by:
bodyPublisherin classjava.net.http.HttpRequest
-
adapterCodec
@CanIgnoreReturnValue public MutableRequest adapterCodec(AdapterCodec adapterCodec)
Set's theAdapterCodecto be used for resolving this request's payload.
-
adapterCodec
public java.util.Optional<AdapterCodec> adapterCodec()
Returns theAdapterCodecto be used for resolving this request's payload.
-
method
public java.lang.String method()
- Specified by:
methodin classjava.net.http.HttpRequest
-
timeout
public java.util.Optional<java.time.Duration> timeout()
- Specified by:
timeoutin classjava.net.http.HttpRequest
-
expectContinue
public boolean expectContinue()
- Specified by:
expectContinuein classjava.net.http.HttpRequest
-
uri
public java.net.URI uri()
An empty
URI(without a scheme, path or a host) is returned if noURIwas previously set.- Specified by:
uriin classjava.net.http.HttpRequest
-
version
public java.util.Optional<java.net.http.HttpClient.Version> version()
- Specified by:
versionin classjava.net.http.HttpRequest
-
headers
public java.net.http.HttpHeaders headers()
- Specified by:
headersin classjava.net.http.HttpRequest
-
hints
public BodyAdapter.Hints hints()
Description copied from class:TaggableRequestReturns this request'sBodyAdapter.Hints.- Specified by:
hintsin classTaggableRequest
-
uri
@CanIgnoreReturnValue public MutableRequest uri(java.net.URI uri)
Sets this request'sURI. Can be relative or without a host or a scheme.- Specified by:
uriin interfacejava.net.http.HttpRequest.Builder- Specified by:
uriin interfaceTaggableRequest.Builder
-
expectContinue
@CanIgnoreReturnValue public MutableRequest expectContinue(boolean enable)
- Specified by:
expectContinuein interfacejava.net.http.HttpRequest.Builder- Specified by:
expectContinuein interfaceTaggableRequest.Builder
-
version
@CanIgnoreReturnValue public MutableRequest version(java.net.http.HttpClient.Version version)
- Specified by:
versionin interfacejava.net.http.HttpRequest.Builder- Specified by:
versionin interfaceTaggableRequest.Builder
-
header
@CanIgnoreReturnValue public MutableRequest header(java.lang.String name, java.lang.String value)
Description copied from interface:HeadersAccumulatorAdds the given header name-value pair.- Specified by:
headerin interfaceHeadersAccumulator<MutableRequest>- Specified by:
headerin interfacejava.net.http.HttpRequest.Builder- Specified by:
headerin interfaceTaggableRequest.Builder
-
headers
@CanIgnoreReturnValue public MutableRequest headers(java.lang.String... headers)
Description copied from interface:HeadersAccumulatorAdds each of the given header name-value pairs. The pairs must be appended to each other in the given array, where each name is followed by a corresponding value.- Specified by:
headersin interfaceHeadersAccumulator<MutableRequest>- Specified by:
headersin interfacejava.net.http.HttpRequest.Builder- Specified by:
headersin interfaceTaggableRequest.Builder
-
headers
@CanIgnoreReturnValue public MutableRequest headers(java.net.http.HttpHeaders headers)
Adds each of the givenHttpHeaders.- Specified by:
headersin interfaceHeadersAccumulator<MutableRequest>
-
setHeader
@CanIgnoreReturnValue public MutableRequest setHeader(java.lang.String name, java.lang.String value)
Description copied from interface:HeadersAccumulatorSets the header represented by the given name to the given value, overwriting the previous value (if any).- Specified by:
setHeaderin interfaceHeadersAccumulator<MutableRequest>- Specified by:
setHeaderin interfacejava.net.http.HttpRequest.Builder- Specified by:
setHeaderin interfaceTaggableRequest.Builder
-
setHeader
public MutableRequest setHeader(java.lang.String name, java.util.List<java.lang.String> values)
Description copied from interface:HeadersAccumulatorSets the header represented by the given name to the given values, overwriting the previous value (if any).- Specified by:
setHeaderin interfaceHeadersAccumulator<MutableRequest>
-
setHeaderIfAbsent
public MutableRequest setHeaderIfAbsent(java.lang.String name, java.lang.String value)
Description copied from interface:HeadersAccumulatorSets the header represented by the given name to the given value, only if there was no header with the given name.- Specified by:
setHeaderIfAbsentin interfaceHeadersAccumulator<MutableRequest>
-
setHeaderIfAbsent
public MutableRequest setHeaderIfAbsent(java.lang.String name, java.util.List<java.lang.String> values)
Description copied from interface:HeadersAccumulatorSets the header represented by the given name to the given values, only if there was no header with the given name.- Specified by:
setHeaderIfAbsentin interfaceHeadersAccumulator<MutableRequest>
-
removeHeaders
@CanIgnoreReturnValue public MutableRequest removeHeaders()
Removes all headers added so far.- Specified by:
removeHeadersin interfaceHeadersAccumulator<MutableRequest>
-
removeHeader
@CanIgnoreReturnValue public MutableRequest removeHeader(java.lang.String name)
Removes any header associated with the given name.- Specified by:
removeHeaderin interfaceHeadersAccumulator<MutableRequest>
-
removeHeadersIf
@CanIgnoreReturnValue public MutableRequest removeHeadersIf(java.util.function.BiPredicate<java.lang.String,java.lang.String> filter)
Removes all headers matched by the given predicate.- Specified by:
removeHeadersIfin interfaceHeadersAccumulator<MutableRequest>
-
timeout
@CanIgnoreReturnValue public MutableRequest timeout(java.time.Duration timeout)
- Specified by:
timeoutin interfacejava.net.http.HttpRequest.Builder- Specified by:
timeoutin interfaceTaggableRequest.Builder
-
GET
@CanIgnoreReturnValue public MutableRequest GET()
- Specified by:
GETin interfacejava.net.http.HttpRequest.Builder- Specified by:
GETin interfaceTaggableRequest.Builder
-
HEAD
@CanIgnoreReturnValue public MutableRequest HEAD()
-
POST
@CanIgnoreReturnValue public MutableRequest POST(java.net.http.HttpRequest.BodyPublisher bodyPublisher)
- Specified by:
POSTin interfacejava.net.http.HttpRequest.Builder- Specified by:
POSTin interfaceTaggableRequest.Builder
-
POST
@CanIgnoreReturnValue public MutableRequest POST(java.lang.Object payload, MediaType mediaType)
Sets the request method to POST and sets the payload to the given value. The media type defines the format used for resolving the payload into aBodyPublisher.
-
POST
@CanIgnoreReturnValue public <T> MutableRequest POST(T payload, TypeRef<T> typeRef, MediaType mediaType)
Sets the request method to POST and sets the payload to the given value with an explicitly specified type. The media type defines the format used for resolving the payload into aBodyPublisher.
-
PUT
@CanIgnoreReturnValue public MutableRequest PUT(java.net.http.HttpRequest.BodyPublisher bodyPublisher)
- Specified by:
PUTin interfacejava.net.http.HttpRequest.Builder- Specified by:
PUTin interfaceTaggableRequest.Builder
-
PUT
@CanIgnoreReturnValue public MutableRequest PUT(java.lang.Object payload, MediaType mediaType)
Sets the request method to PUT and sets the payload to the given value. The media type defines the format used for resolving the payload into aBodyPublisher.
-
PUT
@CanIgnoreReturnValue public <T> MutableRequest PUT(T payload, TypeRef<T> typeRef, MediaType mediaType)
Sets the request method to PUT and sets the payload to the given value with an explicitly specified type. The media type defines the format used for resolving the payload into aBodyPublisher.
-
PATCH
@CanIgnoreReturnValue public MutableRequest PATCH(java.net.http.HttpRequest.BodyPublisher bodyPublisher)
Sets the request method to PATCH and sets the body publisher to the given value.
-
PATCH
@CanIgnoreReturnValue public MutableRequest PATCH(java.lang.Object payload, MediaType mediaType)
Sets the request method to PATCH and sets the payload to the given value. The media type defines the format used for resolving the payload into aBodyPublisher.
-
PATCH
@CanIgnoreReturnValue public <T> MutableRequest PATCH(T payload, TypeRef<T> typeRef, MediaType mediaType)
Sets the request method to PATCH and sets the payload to the given value with an explicitly specified type. The media type defines the format used for resolving the payload into aBodyPublisher.
-
DELETE
@CanIgnoreReturnValue public MutableRequest DELETE()
- Specified by:
DELETEin interfacejava.net.http.HttpRequest.Builder- Specified by:
DELETEin interfaceTaggableRequest.Builder
-
method
@CanIgnoreReturnValue public MutableRequest method(java.lang.String method, java.net.http.HttpRequest.BodyPublisher bodyPublisher)
- Specified by:
methodin interfacejava.net.http.HttpRequest.Builder- Specified by:
methodin interfaceTaggableRequest.Builder
-
method
@CanIgnoreReturnValue public MutableRequest method(java.lang.String method, java.lang.Object payload, MediaType mediaType)
Sets the request method and sets the payload to the given value. The media type defines the format used for resolving this payload into aBodyPublisher.
-
method
@CanIgnoreReturnValue public <T> MutableRequest method(java.lang.String method, T payload, TypeRef<T> typeRef, MediaType mediaType)
Sets the request method and sets the payload to the given value with an explicitly specified type. The media type defines the format used for resolving this payload into aBodyPublisher.
-
build
public TaggableRequest build()
Returns an immutable copy of this request. Prefer usingtoImmutableRequest().- Specified by:
buildin interfacejava.net.http.HttpRequest.Builder- Specified by:
buildin interfaceTaggableRequest.Builder
-
toImmutableRequest
public TaggableRequest toImmutableRequest()
Returns an immutable copy of this request.
-
copy
public MutableRequest copy()
Returns a copy of this request that is independent of this instance.- Specified by:
copyin interfacejava.net.http.HttpRequest.Builder- Specified by:
copyin interfaceTaggableRequest.Builder
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
mimeBody
public java.util.Optional<com.github.mizosoft.methanol.MimeBody> mimeBody()
-
copyOf
public static MutableRequest copyOf(java.net.http.HttpRequest other)
Returns a newMutableRequestthat is a copy of the given request.
-
create
public static MutableRequest create()
Returns a newMutableRequest.
-
create
public static MutableRequest create(java.lang.String uri)
Returns a newMutableRequestwith the given URI and a default GET method.
-
create
public static MutableRequest create(java.net.URI uri)
Returns a newMutableRequestwith the given URI and a default GET method.
-
GET
public static MutableRequest GET(java.lang.String uri)
Returns a newMutableRequestwith the given URI and a GET method.
-
GET
public static MutableRequest GET(java.net.URI uri)
Returns a newMutableRequestwith the given URI and a GET method.
-
HEAD
public static MutableRequest HEAD(java.lang.String uri)
Returns a newMutableRequestwith the given URI and a HEAD method.
-
HEAD
public static MutableRequest HEAD(java.net.URI uri)
Returns a newMutableRequestwith the given URI and a HEAD method.
-
DELETE
public static MutableRequest DELETE(java.lang.String uri)
Returns a newMutableRequestwith the given URI and a DELETE method.
-
DELETE
public static MutableRequest DELETE(java.net.URI uri)
Returns a newMutableRequestwith the given URI and a DELETE method.
-
POST
public static MutableRequest POST(java.lang.String uri, java.net.http.HttpRequest.BodyPublisher bodyPublisher)
Returns a newMutableRequestwith the given URI and a POST method.
-
POST
public static MutableRequest POST(java.net.URI uri, java.net.http.HttpRequest.BodyPublisher bodyPublisher)
Returns a newMutableRequestwith the given URI and a POST method.
-
POST
public static MutableRequest POST(java.lang.String uri, java.lang.Object payload, MediaType mediaType)
Returns a newMutableRequestwith the given URI and a POST method.
-
POST
public static MutableRequest POST(java.net.URI uri, java.lang.Object payload, MediaType mediaType)
Returns a newMutableRequestwith the given URI and a POST method.
-
POST
public static <T> MutableRequest POST(java.lang.String uri, T payload, TypeRef<T> typeRef, MediaType mediaType)
Returns a newMutableRequestwith the given URI and a POST method.
-
POST
public static <T> MutableRequest POST(java.net.URI uri, T payload, TypeRef<T> typeRef, MediaType mediaType)
Returns a newMutableRequestwith the given URI and a POST method.
-
PUT
public static MutableRequest PUT(java.lang.String uri, java.net.http.HttpRequest.BodyPublisher bodyPublisher)
Returns a newMutableRequestwith the given URI and a PUT method.
-
PUT
public static MutableRequest PUT(java.net.URI uri, java.net.http.HttpRequest.BodyPublisher bodyPublisher)
Returns a newMutableRequestwith the given URI and a PUT method.
-
PUT
public static MutableRequest PUT(java.lang.String uri, java.lang.Object payload, MediaType mediaType)
Returns a newMutableRequestwith the given URI and a PUT method.
-
PUT
public static MutableRequest PUT(java.net.URI uri, java.lang.Object payload, MediaType mediaType)
Returns a newMutableRequestwith the given URI and a PUT method.
-
PUT
public static <T> MutableRequest PUT(java.lang.String uri, T payload, TypeRef<T> typeRef, MediaType mediaType)
Returns a newMutableRequestwith the given URI and a PUT method.
-
PUT
public static <T> MutableRequest PUT(java.net.URI uri, T payload, TypeRef<T> typeRef, MediaType mediaType)
Returns a newMutableRequestwith the given URI and a PUT method.
-
PATCH
public static MutableRequest PATCH(java.lang.String uri, java.net.http.HttpRequest.BodyPublisher bodyPublisher)
Returns a newMutableRequestwith the given URI and a PATCH method.
-
PATCH
public static MutableRequest PATCH(java.net.URI uri, java.net.http.HttpRequest.BodyPublisher bodyPublisher)
Returns a newMutableRequestwith the given URI and a PATCH method.
-
PATCH
public static MutableRequest PATCH(java.lang.String uri, java.lang.Object payload, MediaType mediaType)
Returns a newMutableRequestwith the given URI and a PATCH method.
-
PATCH
public static MutableRequest PATCH(java.net.URI uri, java.lang.Object payload, MediaType mediaType)
Returns a newMutableRequestwith the given URI and a PATCH method.
-
PATCH
public static <T> MutableRequest PATCH(java.lang.String uri, T payload, TypeRef<T> typeRef, MediaType mediaType)
Returns a newMutableRequestwith the given URI and a PATCH method.
-
PATCH
public static <T> MutableRequest PATCH(java.net.URI uri, T payload, TypeRef<T> typeRef, MediaType mediaType)
Returns a newMutableRequestwith the given URI and a PATCH method.
-
-