mn.foreman.api.WebUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-api Show documentation
Show all versions of java-api Show documentation
A library for interacting with the Foreman API.
package mn.foreman.api;
import java.util.Map;
import java.util.Optional;
/**
* {@link WebUtil} provides utility functions for performing HTTP operations
* against the Foreman API.
*/
public interface WebUtil {
/**
* Performs a GET
operation against the provided URI.
*
* @param uri The URI.
*
* @return The response content.
*/
Optional get(String uri);
/**
* Performs a GET
operation against the provided URI.
*
* @param uri The URI.
* @param auth Whether or not to auth.
*
* @return The response content.
*/
Optional get(
String uri,
boolean auth);
/**
* Performs a GET
operation against the provided URI.
*
* @param uri The URI.
* @param params The parameters.
*
* @return The response content.
*/
Optional get(
String uri,
Map params);
/**
* Performs a POST
operation against the provided URI.
*
* @param uri The URI.
*
* @return The response content.
*/
Optional post(String uri);
/**
* Performs a POST
operation against the provided URI with
* content.
*
* @param uri The URI.
* @param body The content.
*
* @return The response content.
*/
Optional post(
String uri,
String body);
/**
* Performs a PUT
operation against the provided URI.
*
* @param uri The URI.
* @param body The body.
*
* @return The response content.
*/
Optional put(
String uri,
String body);
}