Index: trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 12594)
+++ trunk/src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 12596)
@@ -119,5 +119,5 @@
 
     /**
-     * Open a connection to the given url and return a reader on the input stream
+     * Open a connection to the given url (if HTTP, trough a GET request) and return a reader on the input stream
      * from that connection. In case of user cancel, return <code>null</code>.
      * @param urlStr The exact url to connect to.
@@ -129,7 +129,26 @@
      * @throws OsmTransferException if data transfer errors occur
      */
+    protected InputStream getInputStreamRaw(String urlStr, ProgressMonitor progressMonitor, String reason,
+            boolean uncompressAccordingToContentDisposition) throws OsmTransferException {
+        return getInputStreamRaw(urlStr, progressMonitor, reason, uncompressAccordingToContentDisposition, "GET", null);
+    }
+
+    /**
+     * Open a connection to the given url (if HTTP, with the specified method) and return a reader on the input stream
+     * from that connection. In case of user cancel, return <code>null</code>.
+     * @param urlStr The exact url to connect to.
+     * @param progressMonitor progress monitoring and abort handler
+     * @param reason The reason to show on console. Can be {@code null} if no reason is given
+     * @param uncompressAccordingToContentDisposition Whether to inspect the HTTP header {@code Content-Disposition}
+     *                                                for {@code filename} and uncompress a gzip/bzip2 stream.
+     * @param httpMethod HTTP method ("GET", "POST" or "PUT")
+     * @param requestBody HTTP request body (for "POST" and "PUT" methods only). Must be null for "GET" method.
+     * @return An reader reading the input stream (servers answer) or <code>null</code>.
+     * @throws OsmTransferException if data transfer errors occur
+     * @since 12596
+     */
     @SuppressWarnings("resource")
     protected InputStream getInputStreamRaw(String urlStr, ProgressMonitor progressMonitor, String reason,
-            boolean uncompressAccordingToContentDisposition) throws OsmTransferException {
+            boolean uncompressAccordingToContentDisposition, String httpMethod, byte[] requestBody) throws OsmTransferException {
         try {
             OnlineResource.JOSM_WEBSITE.checkOfflineAccess(urlStr, Main.getJOSMWebsite());
@@ -151,7 +170,9 @@
             }
 
-            final HttpClient client = HttpClient.create(url);
+            final HttpClient client = HttpClient.create(url, httpMethod)
+                    .setFinishOnCloseOutput(false)
+                    .setReasonForRequest(reason)
+                    .setRequestBody(requestBody);
             activeConnection = client;
-            client.setReasonForRequest(reason);
             adaptRequest(client);
             if (doAuthenticate) {
Index: trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java	(revision 12594)
+++ trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java	(revision 12596)
@@ -6,4 +6,5 @@
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
 import java.util.EnumMap;
 import java.util.Map;
@@ -35,4 +36,6 @@
  */
 public class OverpassDownloadReader extends BoundingBoxDownloader {
+
+    private static final String DATA_PREFIX = "?data=";
 
     static final class OverpassOsmReader extends OsmReader {
@@ -144,5 +147,5 @@
             final String query = this.overpassQuery.replace("{{bbox}}", lat1 + "," + lon1 + "," + lat2 + "," + lon2);
             final String expandedOverpassQuery = expandExtendedQueries(query);
-            return "interpreter?data=" + Utils.encodeUrl(expandedOverpassQuery);
+            return "interpreter" + DATA_PREFIX + Utils.encodeUrl(expandedOverpassQuery);
         }
     }
@@ -195,5 +198,9 @@
                                             boolean uncompressAccordingToContentDisposition) throws OsmTransferException {
         try {
-            return super.getInputStreamRaw(urlStr, progressMonitor, reason, uncompressAccordingToContentDisposition);
+            int index = urlStr.indexOf(DATA_PREFIX);
+            // Make an HTTP POST request instead of a simple GET, allows more complex queries
+            return super.getInputStreamRaw(urlStr.substring(0, index),
+                    progressMonitor, reason, uncompressAccordingToContentDisposition,
+                    "POST", Utils.decodeUrl(urlStr.substring(index + DATA_PREFIX.length())).getBytes(StandardCharsets.UTF_8));
         } catch (OsmApiException ex) {
             final String errorIndicator = "Error</strong>: ";
