static public HttpMethod apiRequest(HttpMethod method, IContext context, String host) throws IOException, IllegalArgumentException {
Flog.info("Sending an API request");
final HttpClient client = new HttpClient();
// NOTE: we cant tell java to follow redirects because they can fail.
HttpConnectionManager connectionManager = client.getHttpConnectionManager();
HttpConnectionParams connectionParams = connectionManager.getParams();
connectionParams.setParameter("http.protocol.handle-redirects", true);
connectionParams.setSoTimeout(5000);
connectionParams.setConnectionTimeout(3000);
connectionParams.setIntParameter(HttpMethodParams.BUFFER_WARN_TRIGGER_LIMIT, 1024 * 1024);
FloorcJson floorcJson = null;
try {
floorcJson = Settings.get();
} catch (Throwable e) {
Flog.warn(e);