Interface RestTarget.Invocation

Enclosing interface:
RestTarget

public static interface RestTarget.Invocation
Represents a request invocation.
Author:
Holger Eichelberger, SSE
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Invoke HTTP DELETE method for the current request synchronously.
    <T> T
    get(Class<T> cls)
    Invoke HTTP GET method for the current request synchronously, read the message entity input stream as an instance of specified Java type.
    default String
    Invoke HTTP GET method for the current request synchronously, read the message entity input stream as an instance of String.
    void
    put(String body)
    Invoke HTTP PUT method for the current request synchronously, taking the creation of the invocation (e.g.
  • Method Details

    • get

      <T> T get(Class<T> cls) throws IOException
      Invoke HTTP GET method for the current request synchronously, read the message entity input stream as an instance of specified Java type.
      Type Parameters:
      T - entity instance Java type
      Parameters:
      cls - the type of entity
      Returns:
      the invocation request in the specified type
      Throws:
      IOException - if invoking/turning the result into the specified type fails
    • getAsString

      default String getAsString() throws IOException
      Invoke HTTP GET method for the current request synchronously, read the message entity input stream as an instance of String.
      Returns:
      the invocation request in the specified type
      Throws:
      IOException - if invoking/turning the result into a String fails
      See Also:
    • put

      void put(String body) throws IOException
      Invoke HTTP PUT method for the current request synchronously, taking the creation of the invocation (e.g. JSON) into account for encoding/creating the body entity.
      Parameters:
      body - the body
      Throws:
      IOException - if invoking/turning the result into a String fails
    • delete

      void delete() throws IOException
      Invoke HTTP DELETE method for the current request synchronously.
      Throws:
      IOException - if invoking delete fails