Interface WebServiceClient
public interface WebServiceClient
A Web Service Client is an HTTP Client that makes requests against a URI defined by configuration.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classAll errors that occur while building or sending requests via aWebServiceClient. -
Method Summary
Modifier and TypeMethodDescriptionrequest()withFragment(String fragment) Constructs a new WebServiceClient with the given fragment in the request URI.Constructs a new WebServiceClient with the given host.Constructs a new WebServiceClient with the given path appended to the request URI.withQueries(Map<String, Collection<String>> queryParameters) Constructs a new WebServiceClient with the given query parameters in the request URI.Creates a new WebServiceClient using the given query string.
-
Method Details
-
withPath
Constructs a new WebServiceClient with the given path appended to the request URI. If the configured URI already contains a path component, the supplied path will be added to it as a sub-path.- Parameters:
path- the path to add to the request URI- Returns:
- a new WebServiceClient
-
withFragment
Constructs a new WebServiceClient with the given fragment in the request URI.- Parameters:
fragment- the fragment to add to the request URI- Returns:
- a new WebServiceClient
-
withQuery
Creates a new WebServiceClient using the given query string. The value is expected to be unencoded and may contain non-ASCII characters. When null is passed, the querystring is cleared.- Parameters:
queryString- the string to use (which should be unencoded and may contain non-ASCII characters)- Returns:
- a web service with the given query string which has been URL form encoded
- Since:
- 3.0.0
-
withQueries
Constructs a new WebServiceClient with the given query parameters in the request URI.- Parameters:
queryParameters- the query parameters to add to the request URI- Returns:
- a new WebServiceClient
-
withHost
Constructs a new WebServiceClient with the given host.- Parameters:
host- the host or IP address of the service to make the request to- Returns:
- the WebServiceClient that will use the given host
- Since:
- 2.4.0
-
request
HttpRequest.Builder request()- Returns:
- a
HttpRequest.Builderfor building and sending the request.
-
cookieManager
- Returns:
- an Optional which contains this client's CookieManager.
-