title: Weather API (RESTful) giving error
body: <p>I am using a simple web API to get weather details for the city <strong>London</strong>. However, I am not getting the required response but instead a <strong>401 Error</strong>. Am I doing anything wrong? </p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;html&gt; 
  &lt;head&gt; 
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"&gt;&lt;/script&gt; 
  &lt;script&gt;
  $(document).ready(function(){
      $('button').click(function(){
          $.ajax({
              type: "get",
              url: "http://api.openweathermap.org/data/2.5/weather?q=London",
              dataType: "json",
              contentType: 'application/json',
              success: function(data) {
                      //What to do on success 
              }
          });
      });
  });
  &lt;/script&gt; 
  &lt;/head&gt; 
  
  &lt;body&gt;
      &lt;button&gt;Click Me&lt;/button&gt;
  &lt;/body&gt; 
  
  &lt;/html&gt; 
  </code></pre>
  
  <p><strong>Using the following api</strong></p>
  
  <p><a href="http://openweathermap.org/current" rel="nofollow noreferrer">http://openweathermap.org/current</a></p>
  
  <p><strong>ERROR</strong></p>
  
  <p><a href="https://i.stack.imgur.com/u69Ul.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u69Ul.png" alt="enter image description here"></a></p>