Interface WebServiceClient


public interface WebServiceClient
A Web Service Client is an HTTP Client that makes requests against a URI defined by configuration.
  • Method Details

    • withPath

      WebServiceClient withPath(String path)
      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

      WebServiceClient withFragment(String fragment)
      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

      WebServiceClient withQuery(@Nullable String queryString)
      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

      WebServiceClient withQueries(Map<String,Collection<String>> queryParameters)
      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

      WebServiceClient withHost(String host)
      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

      Returns:
      a HttpRequest.Builder for building and sending the request.
    • cookieManager

      Returns:
      an Optional which contains this client's CookieManager.