/** * Send a get request * @param url Url as string * @param headers Optional map with headers * @return response Response as string * @throws IOException */ public static String get(String url, Map<String, String> headers) throws IOException { return fetch("GET", url, null, headers); }
/** * Send a delete request * @param url Url as string * @param headers Optional map with headers * @return response Response as string * @throws IOException */ public static String delete(String url, Map<String, String> headers) throws IOException { return fetch("DELETE", url, null, headers); }
/** * Send a post request * @param url Url as string * @param body Request body as string * @param headers Optional map with headers * @return response Response as string * @throws IOException */ public static String post(String url, String body, Map<String, String> headers) throws IOException { return fetch("POST", url, body, headers); }
/** * Send a put request * @param url Url as string * @param body Request body as string * @param headers Optional map with headers * @return response Response as string * @throws IOException */ public static String put(String url, String body, Map<String, String> headers) throws IOException { return fetch("PUT", url, body, headers); }
return fetch(method, location, body, headers);