Interface Submitter.Response

Enclosing interface:
Submitter

public static interface Submitter.Response
Represents the response received from executing a request.
  • Method Details

    • create

      static Submitter.Response create(int statusCode, Submitter.Response.InputStreamSupplier supplier, Exception exception)
      Creates a new Submitter.Response instance.
      Parameters:
      statusCode - the status code
      supplier - the input stream supplier (can be null)
      exception - the exception (can be null)
      Returns:
      the response instance
    • getStatusCode

      int getStatusCode()
      Gets the HTTP response status code, or 0 / -1 if a client-side exception occurred.
      Returns:
      the status code
    • getInputStream

      InputStream getInputStream() throws IOException
      Gets the response body input stream.
      Returns:
      the input stream
      Throws:
      IOException - if an I/O error occurs
    • getException

      Optional<Exception> getException()
      Gets the exception that occurred during execution, if any.
      Returns:
      the exception, or empty if successful
    • readString

      default String readString() throws Exception
      Reads the entire response body stream as a UTF-8 String.
      Returns:
      the response body as a String
      Throws:
      Exception - if an I/O or conversion error occurs