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

com.github.kristofa.test.http.client.HttpClientResponse Maven / Gradle / Ivy

Go to download

Mock and Proxy HTTP Server for testing purposes. Forked from https://github.com/jharlap/mock-http-server

There is a newer version: 4.1
Show newest version
package com.github.kristofa.test.http.client;

/**
 * Http Response as being returned by a {@link HttpClient}. Provides the user with the HTTP response code, response entity
 * and optional error message.
 * 

* IMPORTANT: Call {@link HttpClientResponse#close()} method when done with process response. This will clean-up resources. * * @author kristof * @param Type for response entity. */ public interface HttpClientResponse { /** * Indicates if result of http request was successful. Response was successful in case there is no error message. * * @return true in case request was successful, false in case request failed. */ boolean success(); /** * Gets the HTTP return code. * * @return the httpCode */ int getHttpCode(); /** * In case request failed this will return the error message. * * @return the error message. Will be null in case request was successful. */ String getErrorMessage(); /** * Gets response object as a result of executing http request. * * @return the response Response as a result of executing http request. */ T getResponseEntity(); /** * Closes all resources related to this request/response. */ void close(); /** * Get Content-Type. * * @return Content-Type. */ String getContentType(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy