title: Java URL Without Protocol
body: <p>I'm trying to open an InputStream to a certain URL as given by the service's API. However, it does not have a set protocol (it's not http or https) and without one, I am getting the following error. </p>
  
  <p>Is there any way to get a request without a protocol?</p>
  
  <h2>Exception:</h2>
  
  <blockquote>
    <p>Exception in thread "main" java.net.MalformedURLException: no protocol. </p>
  </blockquote>
  
  <h2>Code:</h2>
  
  <pre><code>    String url = "maple.fm/api/2/search?server=1";
      InputStream is = new URL(url).openStream();
  </code></pre>
  
  <p>UPDATE: I now updated the code to:</p>
  
  <h2>Code:</h2>
  
  <pre><code>    String url = "http://maple.fm/api/2/search?server=1";
      InputStream is = new URL(url).openStream();
  </code></pre>
  
  <p>and now I'm getting the following error:</p>
  
  <h2>Exception:</h2>
  
  <blockquote>
    <p>Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: <a href="http://maple.fm/api/2/search?server=1" rel="nofollow">http://maple.fm/api/2/search?server=1</a></p>
  </blockquote>