public interface WebClient extends ClientBuilderParams, Unwrappable
| Modifier and Type | Method and Description |
|---|---|
static WebClientBuilder |
builder()
Returns a new
WebClientBuilder created without a base URI. |
static WebClientBuilder |
builder(SessionProtocol sessionProtocol,
Endpoint endpoint)
|
static WebClientBuilder |
builder(String uri)
Returns a new
WebClientBuilder created with the specified base uri. |
static WebClientBuilder |
builder(URI uri)
Returns a new
WebClientBuilder created with the specified base URI. |
default HttpResponse |
delete(String path)
Sends an HTTP DELETE request.
|
HttpResponse |
execute(AggregatedHttpRequest aggregatedReq)
Sends the specified HTTP request.
|
HttpResponse |
execute(HttpRequest req)
Sends the specified HTTP request.
|
default HttpResponse |
execute(RequestHeaders headers)
Sends an empty HTTP request with the specified headers.
|
default HttpResponse |
execute(RequestHeaders headers,
byte[] content)
Sends an HTTP request with the specified headers and content.
|
default HttpResponse |
execute(RequestHeaders headers,
HttpData content)
Sends an HTTP request with the specified headers and content.
|
default HttpResponse |
execute(RequestHeaders headers,
String content)
Sends an HTTP request with the specified headers and content.
|
default HttpResponse |
execute(RequestHeaders headers,
String content,
Charset charset)
Sends an HTTP request with the specified headers and content.
|
default HttpResponse |
get(String path)
Sends an HTTP GET request.
|
default HttpResponse |
head(String path)
Sends an HTTP HEAD request.
|
static WebClient |
of()
Creates a new web client without a base URI using the default
ClientFactory and
the default ClientOptions. |
static WebClient |
of(ClientFactory factory,
SessionProtocol protocol,
Endpoint endpoint,
ClientOptions options)
Creates a new web client that connects to the specified
Endpoint with
the SessionProtocol using an alternative ClientFactory. |
static WebClient |
of(ClientFactory factory,
SessionProtocol protocol,
Endpoint endpoint,
ClientOptionValue<?>... options)
Creates a new web client that connects to the specified
Endpoint with
the SessionProtocol using an alternative ClientFactory. |
static WebClient |
of(ClientFactory factory,
String uri,
ClientOptions options)
Creates a new web client that connects to the specified
uri using an alternative
ClientFactory. |
static WebClient |
of(ClientFactory factory,
String uri,
ClientOptionValue<?>... options)
Creates a new web client that connects to the specified
uri using an alternative
ClientFactory. |
static WebClient |
of(ClientFactory factory,
URI uri,
ClientOptions options)
Creates a new web client that connects to the specified
URI using an alternative
ClientFactory. |
static WebClient |
of(ClientFactory factory,
URI uri,
ClientOptionValue<?>... options)
Creates a new web client that connects to the specified
URI using an alternative
ClientFactory. |
static WebClient |
of(SessionProtocol protocol,
Endpoint endpoint,
ClientOptions options)
Creates a new web client that connects to the specified
Endpoint with
the SessionProtocol using the default ClientFactory. |
static WebClient |
of(SessionProtocol protocol,
Endpoint endpoint,
ClientOptionValue<?>... options)
Creates a new web client that connects to the specified
Endpoint with
the SessionProtocol using the default ClientFactory. |
static WebClient |
of(String uri,
ClientOptions options)
Creates a new web client that connects to the specified
uri using the default
ClientFactory. |
static WebClient |
of(String uri,
ClientOptionValue<?>... options)
Creates a new web client that connects to the specified
uri using the default
ClientFactory. |
static WebClient |
of(URI uri,
ClientOptions options)
Creates a new web client that connects to the specified
URI using the default
ClientFactory. |
static WebClient |
of(URI uri,
ClientOptionValue<?>... options)
Creates a new web client that connects to the specified
URI using the default
ClientFactory. |
default HttpResponse |
options(String path)
Sends an HTTP OPTIONS request.
|
default HttpResponse |
patch(String path,
byte[] content)
Sends an HTTP PATCH request with the specified content.
|
default HttpResponse |
patch(String path,
HttpData content)
Sends an HTTP PATCH request with the specified content.
|
default HttpResponse |
patch(String path,
String content)
Sends an HTTP PATCH request with the specified content.
|
default HttpResponse |
patch(String path,
String content,
Charset charset)
Sends an HTTP PATCH request with the specified content.
|
default HttpResponse |
post(String path,
byte[] content)
Sends an HTTP POST request with the specified content.
|
default HttpResponse |
post(String path,
HttpData content)
Sends an HTTP POST request with the specified content.
|
default HttpResponse |
post(String path,
String content)
Sends an HTTP POST request with the specified content.
|
default HttpResponse |
post(String path,
String content,
Charset charset)
Sends an HTTP POST request with the specified content.
|
default HttpResponse |
put(String path,
byte[] content)
Sends an HTTP PUT request with the specified content.
|
default HttpResponse |
put(String path,
HttpData content)
Sends an HTTP PUT request with the specified content.
|
default HttpResponse |
put(String path,
String content)
Sends an HTTP PUT request with the specified content.
|
default HttpResponse |
put(String path,
String content,
Charset charset)
Sends an HTTP PUT request with the specified content.
|
default HttpResponse |
trace(String path)
Sends an HTTP TRACE request.
|
clientType, factory, options, uriasstatic WebClient of()
ClientFactory and
the default ClientOptions.static WebClient of(String uri, ClientOptionValue<?>... options)
uri using the default
ClientFactory.uri - the URI of the server endpointoptions - the ClientOptionValuesIllegalArgumentException - if the scheme of the specified uri is not an HTTP schemestatic WebClient of(String uri, ClientOptions options)
uri using the default
ClientFactory.uri - the URI of the server endpointoptions - the ClientOptionsIllegalArgumentException - if the scheme of the specified uri is not an HTTP schemestatic WebClient of(ClientFactory factory, String uri, ClientOptionValue<?>... options)
uri using an alternative
ClientFactory.factory - an alternative ClientFactoryuri - the URI of the server endpointoptions - the ClientOptionValuesIllegalArgumentException - if the scheme of the specified uri is not an HTTP schemestatic WebClient of(ClientFactory factory, String uri, ClientOptions options)
uri using an alternative
ClientFactory.factory - an alternative ClientFactoryuri - the URI of the server endpointoptions - the ClientOptionsIllegalArgumentException - if the scheme of the specified uri is not an HTTP schemestatic WebClient of(URI uri, ClientOptionValue<?>... options)
URI using the default
ClientFactory.uri - the URI of the server endpointoptions - the ClientOptionValuesIllegalArgumentException - if the scheme of the specified uri is not an HTTP schemestatic WebClient of(URI uri, ClientOptions options)
URI using the default
ClientFactory.uri - the URI of the server endpointoptions - the ClientOptionsIllegalArgumentException - if the scheme of the specified uri is not an HTTP schemestatic WebClient of(ClientFactory factory, URI uri, ClientOptionValue<?>... options)
URI using an alternative
ClientFactory.factory - an alternative ClientFactoryuri - the URI of the server endpointoptions - the ClientOptionValuesIllegalArgumentException - if the scheme of the specified uri is not an HTTP schemestatic WebClient of(ClientFactory factory, URI uri, ClientOptions options)
URI using an alternative
ClientFactory.factory - an alternative ClientFactoryuri - the URI of the server endpointoptions - the ClientOptionsIllegalArgumentException - if the scheme of the specified uri is not an HTTP schemestatic WebClient of(SessionProtocol protocol, Endpoint endpoint, ClientOptionValue<?>... options)
Endpoint with
the SessionProtocol using the default ClientFactory.protocol - the SessionProtocol of the Endpointendpoint - the server Endpointoptions - the ClientOptionValuesstatic WebClient of(SessionProtocol protocol, Endpoint endpoint, ClientOptions options)
Endpoint with
the SessionProtocol using the default ClientFactory.protocol - the SessionProtocol of the Endpointendpoint - the server Endpointoptions - the ClientOptionsstatic WebClient of(ClientFactory factory, SessionProtocol protocol, Endpoint endpoint, ClientOptionValue<?>... options)
Endpoint with
the SessionProtocol using an alternative ClientFactory.factory - an alternative ClientFactoryprotocol - the SessionProtocol of the Endpointendpoint - the server Endpointoptions - the ClientOptionValuesstatic WebClient of(ClientFactory factory, SessionProtocol protocol, Endpoint endpoint, ClientOptions options)
Endpoint with
the SessionProtocol using an alternative ClientFactory.factory - an alternative ClientFactoryprotocol - the SessionProtocol of the Endpointendpoint - the server Endpointoptions - the ClientOptionsstatic WebClientBuilder builder()
WebClientBuilder created without a base URI.static WebClientBuilder builder(String uri)
WebClientBuilder created with the specified base uri.IllegalArgumentException - if the scheme of the uri is not one of the fields
in SessionProtocol or the uri violates RFC 2396static WebClientBuilder builder(URI uri)
WebClientBuilder created with the specified base URI.IllegalArgumentException - if the scheme of the uri is not one of the fields
in SessionProtocolstatic WebClientBuilder builder(SessionProtocol sessionProtocol, Endpoint endpoint)
IllegalArgumentException - if the sessionProtocol is not one of the fields
in SessionProtocolHttpResponse execute(HttpRequest req)
HttpResponse execute(AggregatedHttpRequest aggregatedReq)
default HttpResponse execute(RequestHeaders headers)
default HttpResponse execute(RequestHeaders headers, HttpData content)
default HttpResponse execute(RequestHeaders headers, byte[] content)
default HttpResponse execute(RequestHeaders headers, String content)
default HttpResponse execute(RequestHeaders headers, String content, Charset charset)
default HttpResponse options(String path)
default HttpResponse get(String path)
default HttpResponse head(String path)
default HttpResponse post(String path, HttpData content)
default HttpResponse post(String path, byte[] content)
default HttpResponse post(String path, String content)
default HttpResponse post(String path, String content, Charset charset)
default HttpResponse put(String path, HttpData content)
default HttpResponse put(String path, byte[] content)
default HttpResponse put(String path, String content)
default HttpResponse put(String path, String content, Charset charset)
default HttpResponse patch(String path, HttpData content)
default HttpResponse patch(String path, byte[] content)
default HttpResponse patch(String path, String content)
default HttpResponse patch(String path, String content, Charset charset)
default HttpResponse delete(String path)
default HttpResponse trace(String path)
Copyright © 2020 LeanCloud. All rights reserved.