Class HttpResponse


  • public class HttpResponse
    extends Object
    This class is used to define a response to a http-request
    • Field Detail

      • UNKNOWN_REQUEST

        public static final int UNKNOWN_REQUEST
        Unknown request type error code
        See Also:
        Constant Field Values
      • EXCEPTION

        public static final int EXCEPTION
        Exception thrown error code
        See Also:
        Constant Field Values
    • Constructor Detail

      • HttpResponse

        public HttpResponse​(Plugin plugin,
                            Exception e)
        Initialize an exception thrown HttpResponse with e
        Parameters:
        plugin - the request plugin
        e - the thrown exception in this http-request processing
      • HttpResponse

        public HttpResponse​(Plugin plugin,
                            int code,
                            okhttp3.Headers headers,
                            String value)
        Initialize a HttpResponse without exceptions
        Parameters:
        plugin - the request plugin
        code - the response code
        headers - the response header
        value - the response data
    • Method Detail

      • getException

        @Nullable
        public Exception getException()
      • getCode

        public int getCode()
      • getResponse

        @Nullable
        public String getResponse()
      • getHeaders

        @Nullable
        public okhttp3.Headers getHeaders()
      • getPlugin

        public Plugin getPlugin()
      • isError

        @EnsuresNonNullIf(result=true,
                          expression="getException()")
        public boolean isError()
        Indicate this is an exception thrown HttpResponse
        Returns:
        true if this is an exception thrown HttpResponse, false otherwise