title: When is protocol required in http/https request URLs
body: <p>When is the protocol required in http/https requests URLs  Are there any pros or cons of doing one way or the other?  Whether or not it is absolutely required, is there a considered a best practice?</p>
  
  <p>For instance, all of the following links are valid since if the protocol is not specified, it defaults to the current page request.</p>
  
  <pre><code>&lt;img class="map" src="https://maps.google.com/maps/api/staticmap?markers=color" alt="Map" /&gt;
  
  &lt;img class="map" src="//maps.google.com/maps/api/staticmap?markers=color" alt="Map" /&gt;
  
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Another similar application would be curl requests.  I expect protocol is required, but am not certain.</p>
  
  <pre><code>$c = curl_init();
  curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($c, CURLOPT_URL, "https://maps.google.com/maps/api/geocode/json?sensor=false&amp;address=xyz");
  </code></pre>