title: FileNotFoundException with 404 status for valid URL on HTTP GET request
body: <p>I have the following code to perform a GET request on the following URL:</p>
  
  <pre><code>http://rt.hnnnglmbrg.de/server.php/someReferenceNumber
  </code></pre>
  
  <p>However, here is my output from Logcat:</p>
  
  <pre><code>java.io.FileNotFoundException: http://rt.hnnnglmbrg.de/server.php/6
  </code></pre>
  
  <p><strong>Why does it return 404 when the URL is clearly valid?</strong></p>
  
  <p>Here is my connect code:</p>
  
  <pre><code>/**
   * Performs an HTTP GET request that returns base64 data from the server
   * 
   * @param ref
   *            The Accident's reference
   * @return The base64 data from the server.
   */
  public static String performGet(String ref) {
      String returnRef = null;
      try {
          URL url = new URL(SERVER_URL + "/" + ref);
          HttpURLConnection con = (HttpURLConnection) url.openConnection();
          con.setRequestMethod("GET");
  
          BufferedReader reader = new BufferedReader(new InputStreamReader(con.getInputStream()));
  
          StringBuilder builder = new StringBuilder();
          String line;
          while ((line = reader.readLine()) != null) {
              builder.append(line);
          }
  
          returnRef = builder.toString();
  
      } catch (IOException e) {
          e.printStackTrace();
      }
      return returnRef;
  }
  </code></pre>