All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.dongliu.cute.http.ResponseHandler Maven / Gradle / Ivy

The newest version!
package net.dongliu.cute.http;

import java.io.Closeable;
import java.io.IOException;

/**
 * Handle response in blocking way.
 *
 * @param  the original Response body type, could be InputStream or Reader
 * @param  the converted response body type.
 */
@FunctionalInterface
public interface ResponseHandler {
    /**
     * Handler response body with all info, return a transformed response body.
     *
     * @return the value body convert to
     */
    T handle(ResponseInfo info, B body) throws IOException;
}