public HttpReq data(String name, Object value) { data().put(name, value); return this; }
public static HttpReq data(Map<String, String> data) { return req().data(data); }
private boolean doDeploy(String url) { getLog().info(" - deploying the staged application on: " + url); return request(HTTP.post(url).data("_token", token)); }
private boolean doStage(Upload jar, String url) { getLog().info(" - uploading / staging the uber-jar to: " + url); return request(HTTP.post(url).data("_token", token).file("file", U.list(jar))); }
static HttpRequestBase createRequest(HttpReq config) { Map<String, String> headers = U.safe(config.headers()); Map<String, String> cookies = U.safe(config.cookies()); String url = config.url(); url = Msc.urlWithProtocol(url); HttpRequestBase req = createReq(config, url); for (Map.Entry<String, String> e : headers.entrySet()) { req.addHeader(e.getKey(), e.getValue()); } if (U.notEmpty(cookies)) { req.addHeader("Cookie", joinCookiesAsHeader(cookies)); } switch (config.verb()) { case POST: case PUT: case PATCH: HttpEntityEnclosingRequestBase entityEnclosingReq = (HttpEntityEnclosingRequestBase) req; if (config.body() != null) { entityEnclosingReq.setEntity(byteBody(config)); } else if (U.notEmpty(config.data()) || U.notEmpty(config.files())) { entityEnclosingReq.setEntity(paramsBody(config.data(), config.files())); } break; } req.setConfig(reqConfig(config)); return req; }
private boolean doDeploy(String url) { getLog().info(" - deploying the staged application on: " + url); return request(HTTP.post(url).data("_token", token)); }
private boolean doStage(Upload jar, String url) { getLog().info(" - uploading / staging the uber-jar to: " + url); return request(HTTP.post(url).data("_token", token).file("file", U.list(jar))); }