diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryServiceServlet.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryServiceServlet.java
index d3507d8..90e8adf 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryServiceServlet.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryServiceServlet.java
@@ -384,18 +384,6 @@
         }
     }
 
-    @Override
-    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
-        String query = request.getParameter(Parameter.STATEMENT.str());
-        try {
-            handleRequest(request, response, query);
-        } catch (IOException e) {
-            // Servlet methods should not throw exceptions
-            // http://cwe.mitre.org/data/definitions/600.html
-            GlobalConfig.ASTERIX_LOGGER.log(Level.SEVERE, e.getMessage(), e);
-        }
-    }
-
     private void handleRequest(HttpServletRequest request, HttpServletResponse response, String query)
             throws IOException {
         long elapsedStart = System.nanoTime();
diff --git a/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/aql/TestExecutor.java b/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/aql/TestExecutor.java
index 6bfbd64..45a5fc4 100644
--- a/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/aql/TestExecutor.java
+++ b/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/aql/TestExecutor.java
@@ -44,10 +44,10 @@
 import org.apache.asterix.test.server.ITestServer;
 import org.apache.asterix.test.server.TestServerProvider;
 import org.apache.asterix.testframework.context.TestCaseContext;
-import org.apache.asterix.testframework.context.TestCaseContext.OutputFormat;
 import org.apache.asterix.testframework.context.TestFileContext;
-import org.apache.asterix.testframework.xml.TestCase.CompilationUnit;
+import org.apache.asterix.testframework.context.TestCaseContext.OutputFormat;
 import org.apache.asterix.testframework.xml.TestGroup;
+import org.apache.asterix.testframework.xml.TestCase.CompilationUnit;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.mutable.MutableInt;
 import org.apache.http.HttpResponse;
@@ -280,8 +280,8 @@
         return httpResponse;
     }
 
-    public InputStream executeQuery(String str, OutputFormat fmt, String url,
-            List<CompilationUnit.Parameter> params) throws Exception {
+    public InputStream executeQuery(String str, OutputFormat fmt, String url, List<CompilationUnit.Parameter> params)
+            throws Exception {
         HttpUriRequest method = constructHttpMethod(str, url, "query", false, params);
         // Set accepted output response type
         method.setHeader("Accept", fmt.mimeType());
@@ -292,7 +292,7 @@
     public InputStream executeQueryService(String str, OutputFormat fmt, String url,
             List<CompilationUnit.Parameter> params) throws Exception {
         setFormatParam(params, fmt);
-        HttpUriRequest method = constructHttpMethod(str, url, "statement", true, params);
+        HttpUriRequest method = constructPostMethod(str, url, "statement", true, params);
         // Set accepted output response type
         method.setHeader("Accept", OutputFormat.CLEAN_JSON.mimeType());
         HttpResponse response = executeHttpRequest(method);
@@ -315,28 +315,38 @@
         }
     }
 
-    private HttpUriRequest constructHttpMethod(String statement, String endpoint, String stmtParam, boolean postStmtAsParam,
-            List<CompilationUnit.Parameter> otherParams) {
-        RequestBuilder builder;
+    private HttpUriRequest constructHttpMethod(String statement, String endpoint, String stmtParam,
+            boolean postStmtAsParam, List<CompilationUnit.Parameter> otherParams) {
         if (statement.length() + endpoint.length() < MAX_URL_LENGTH) {
             // Use GET for small-ish queries
-            builder = RequestBuilder.get(endpoint);
-            builder.addParameter(stmtParam, statement);
+            return constructGetMethod(statement, endpoint, stmtParam, otherParams);
+        } else {
+            // Use POST for bigger ones to avoid 413 FULL_HEAD
+            return constructPostMethod(statement, endpoint, stmtParam, postStmtAsParam, otherParams);
+        }
+    }
+
+    private HttpUriRequest constructGetMethod(String statement, String endpoint, String stmtParam,
+            List<CompilationUnit.Parameter> otherParams) {
+        RequestBuilder builder = RequestBuilder.get(endpoint).addParameter(stmtParam, statement);
+        for (CompilationUnit.Parameter param : otherParams) {
+            builder.addParameter(param.getName(), param.getValue());
+        }
+        builder.setCharset(StandardCharsets.UTF_8);
+        return builder.build();
+    }
+
+    private HttpUriRequest constructPostMethod(String statement, String endpoint, String stmtParam,
+            boolean postStmtAsParam, List<CompilationUnit.Parameter> otherParams) {
+        RequestBuilder builder = RequestBuilder.post(endpoint);
+        if (postStmtAsParam) {
             for (CompilationUnit.Parameter param : otherParams) {
                 builder.addParameter(param.getName(), param.getValue());
             }
+            builder.addParameter(stmtParam, statement);
         } else {
-            // Use POST for bigger ones to avoid 413 FULL_HEAD
-            builder = RequestBuilder.post(endpoint);
-            if (postStmtAsParam) {
-                for (CompilationUnit.Parameter param : otherParams) {
-                    builder.addParameter(param.getName(), param.getValue());
-                }
-                builder.addParameter("statement", statement);
-            } else {
-                // this seems pretty bad - we should probably fix the API and not the client
-                builder.setEntity(new StringEntity(statement, StandardCharsets.UTF_8));
-            }
+            // this seems pretty bad - we should probably fix the API and not the client
+            builder.setEntity(new StringEntity(statement, StandardCharsets.UTF_8));
         }
         builder.setCharset(StandardCharsets.UTF_8);
         return builder.build();
