public interface WebClient
ClientHttpConnector
.
Use one of the static factory methods create()
or
create(String)
or obtain a builder()
to create an
instance.
For examples with a response body see
retrieve()
and
exchange()
.
For examples with a request body see
body(Publisher,Class)
,
syncBody(Object)
, and
body(BodyInserter)
.
Modifier and Type | Interface and Description |
---|---|
static interface |
WebClient.Builder
A mutable builder for creating a
WebClient . |
static interface |
WebClient.RequestBodySpec |
static interface |
WebClient.RequestBodyUriSpec |
static interface |
WebClient.RequestHeadersSpec<S extends WebClient.RequestHeadersSpec<S>>
Contract for specifying request headers leading up to the exchange.
|
static interface |
WebClient.RequestHeadersUriSpec<S extends WebClient.RequestHeadersSpec<S>> |
static interface |
WebClient.ResponseSpec |
static interface |
WebClient.UriSpec<S extends WebClient.RequestHeadersSpec<?>>
Contract for specifying the URI for a request.
|
Modifier and Type | Method and Description |
---|---|
static WebClient.Builder |
builder()
Obtain a
WebClient builder. |
static WebClient |
create()
Create a new
WebClient with a Reactor Netty connector. |
static WebClient |
create(java.lang.String baseUrl)
A variant of
create() that accepts a default base URL. |
WebClient.RequestHeadersUriSpec<?> |
delete()
Prepare an HTTP DELETE request.
|
WebClient.RequestHeadersUriSpec<?> |
get()
Prepare an HTTP GET request.
|
WebClient.RequestHeadersUriSpec<?> |
head()
Prepare an HTTP HEAD request.
|
WebClient.RequestBodyUriSpec |
method(HttpMethod method)
Prepare a request for the specified
HttpMethod . |
WebClient.Builder |
mutate()
Return a builder to mutate properties of this web client.
|
WebClient.RequestHeadersUriSpec<?> |
options()
Prepare an HTTP OPTIONS request.
|
WebClient.RequestBodyUriSpec |
patch()
Prepare an HTTP PATCH request.
|
WebClient.RequestBodyUriSpec |
post()
Prepare an HTTP POST request.
|
WebClient.RequestBodyUriSpec |
put()
Prepare an HTTP PUT request.
|
WebClient.RequestHeadersUriSpec<?> get()
WebClient.RequestHeadersUriSpec<?> head()
WebClient.RequestBodyUriSpec post()
WebClient.RequestBodyUriSpec put()
WebClient.RequestBodyUriSpec patch()
WebClient.RequestHeadersUriSpec<?> delete()
WebClient.RequestHeadersUriSpec<?> options()
WebClient.RequestBodyUriSpec method(HttpMethod method)
HttpMethod
.WebClient.Builder mutate()
static WebClient create()
WebClient
with a Reactor Netty connector.create(String)
,
builder()
static WebClient create(java.lang.String baseUrl)
create()
that accepts a default base URL. For more
details see Builder.baseUrl(String)
.baseUrl
- the base URI for all requestsstatic WebClient.Builder builder()
WebClient
builder.