io.descoped.dc.api.http.Response Maven / Gradle / Ivy
The newest version!
package io.descoped.dc.api.http;
import java.util.Optional;
import java.util.ServiceLoader;
public interface Response {
static Builder newResponseBuilder() {
return ServiceLoader.load(Response.Builder.class).findFirst().orElseThrow();
}
String url();
Headers headers();
int statusCode();
byte[] body();
/**
* Use: Response.bodyHandler()
*
* @param
* @return
*/
Optional> bodyHandler();
Optional previousResponse();
interface Builder {
Builder delegate(Object delegate);
void bodyHandler(BodyHandler bodyHandler);
Response build();
}
}