/** * Sends a DELETE request. * * @param url * the url where to send the DELETE request. * @return the delete response. */ public static BotMillNetworkResponse delete(String url) { HttpDelete delete = new HttpDelete(url); return send(delete); }
/** * Utility to send a GET request. * * @param url * the url we need to send the get request to. * @return the get response. */ public static BotMillNetworkResponse get(String url) { HttpGet get = new HttpGet(url); return send(get); }
/** * Utility to send a POST request. * * @param url * the url we need to send the post request to. * @param entity * the entity that containts the object we need to pass as part * of the post request. * @return the post response. */ public static BotMillNetworkResponse post(String url, StringEntity entity) { HttpPost post = new HttpPost(url); //post.setHeader("Content-Type", "application/x-www-form-urlencoded"); post.setHeader("Content-Type","application/json"); post.setEntity(entity); return send(post); }
/** * Sends a DELETE request with a body. * * @param url * the url where to send the DELETE request. * @param entity * the entity to DELETE. * @return the delete response. */ public static BotMillNetworkResponse delete(String url, StringEntity entity) { HttpDeleteWithBody delete = new HttpDeleteWithBody(url); delete.setEntity(entity); return send(delete); }