Interface Client

All Known Implementing Classes:
AbstractClient, ClientProxyImpl, WebClient

public interface Client
Represents common proxy and http-centric client capabilities
  • Method Details

    • type

      Client type(jakarta.ws.rs.core.MediaType ct)
      Set HTTP Content-Type header
      Parameters:
      ct - JAXRS MediaType representing Content-Type value
      Returns:
      the updated Client
    • type

      Client type(String type)
      Set HTTP Content-Type header
      Parameters:
      type - Content-Type value
      Returns:
      the updated Client
    • accept

      Client accept(jakarta.ws.rs.core.MediaType... types)
      Set HTTP Accept header
      Parameters:
      types - list of JAXRS MediaTypes representing Accept header values
      Returns:
      the updated Client
    • accept

      Client accept(String... types)
      Set HTTP Accept header
      Parameters:
      types - list of Accept header values
      Returns:
      the updated Client
    • language

      Client language(String language)
      Set HTTP Content-Language header
      Parameters:
      language - Content-Language header value
      Returns:
      the updated Client
    • acceptLanguage

      Client acceptLanguage(String... languages)
      Set HTTP Accept-Language header
      Parameters:
      languages - list of Accept-Language header values
      Returns:
      the updated Client
    • encoding

      Client encoding(String encoding)
      Set HTTP Content-Encoding header
      Parameters:
      encoding - Content-Encoding header value
      Returns:
      the updated Client
    • acceptEncoding

      Client acceptEncoding(String... encodings)
      Set HTTP Accept-Encoding header
      Parameters:
      encodings - list of Accept-Encoding header value
      Returns:
      the updated Client
    • match

      Client match(jakarta.ws.rs.core.EntityTag tag, boolean ifNot)
      Set HTTP If-Match or If-None-Match header
      Parameters:
      tag - ETag value
      ifNot - if true then If-None-Match is set, If-Match otherwise
      Returns:
      the updated Client
    • modified

      Client modified(Date date, boolean ifNot)
      Set HTTP If-Modified-Since or If-Unmodified-Since header
      Parameters:
      date - Date value, will be formated as "EEE, dd MMM yyyy HH:mm:ss zzz"
      ifNot - if true then If-Unmodified-Since is set, If-Modified-Since otherwise
      Returns:
      the updated Client
    • cookie

      Client cookie(jakarta.ws.rs.core.Cookie cookie)
      Set HTTP Cookie header
      Parameters:
      cookie - Cookie value
      Returns:
      the updated Client
    • authorization

      Client authorization(Object auth)
      Set HTTP Authorization header
      Parameters:
      auth - Authorization value
      Returns:
      the updated Client
    • query

      Client query(String name, Object... values)
      Update the current URI query parameters
      Parameters:
      name - query name
      values - query values
      Returns:
      updated WebClient
    • header

      Client header(String name, Object... values)
      Set arbitrary HTTP Header
      Parameters:
      name - header name
      values - list of header values
      Returns:
      the updated Client
    • headers

      Client headers(jakarta.ws.rs.core.MultivaluedMap<String,String> map)
      Set HTTP Headers
      Parameters:
      map - headers
      Returns:
      the updated Client
    • reset

      Client reset()
      Reset the headers and response state if any
      Returns:
      the updated Client
    • getHeaders

      jakarta.ws.rs.core.MultivaluedMap<String,String> getHeaders()
      Get the copy of request headers
      Returns:
      request headers
    • getBaseURI

      URI getBaseURI()
      Get the base URI this Client has been intialized with
      Returns:
      base URI
    • getCurrentURI

      URI getCurrentURI()
      Get the current URI this Client is working with
      Returns:
      current URI
    • getResponse

      jakarta.ws.rs.core.Response getResponse()
      Get the response state if any
      Returns:
      JAXRS Response response
    • close

      void close()
      Release the internal state and configuration associated with this client