Interface IStatefulResponseHandler<ResultType,DeserializedType>

Type Parameters:
ResultType - the result to return
DeserializedType - the deserialize type for serializer

public interface IStatefulResponseHandler<ResultType,DeserializedType>
The handler interface for requests having stateful response from server. The handler will custom the HTTP connection if needed and generate request result based on the server HTTP response.
  • Method Details

    • generateResult

      @Nullable <ResponseType> ResultType generateResult(@Nonnull IHttpRequest request, @Nonnull ResponseType response, @Nonnull ISerializer serializer, @Nonnull ILogger logger) throws Exception
      Generate result after receiving response
      Type Parameters:
      ResponseType - the native http client response type
      Parameters:
      request - the HTTP request
      response - the HTTP connection
      serializer - the serializer for parsing response
      logger - the logger
      Returns:
      the result generated by this handler
      Throws:
      Exception - an exception occurs if the request was unable to complete for any reason