title: Firebase Push Notifications with jQuery (Javascript)
body: <p>I am attempting to send a push notification from a simple test webpage. I am using firebase. This is my current code:</p>
  
  <pre><code>function sendPushNotification() {
      $.ajax({        
          type : 'POST',
          url : "https://fcm.googleapis.com/fcm/send",
          headers : {
              Authorization : 'key=' + '&lt;my_server_key&gt;',
              'Content-Type' : 'application/json'
          },
          contentType : 'application/json',
          dataType: 'json',
          data: JSON.stringify({"notification": {"body":"Test"}}),
          success : function(response) {
              console.log(response);
          },
          error : function(xhr, status, error) {
              console.log(xhr);                   
          }
      });
  }
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>[Error] Failed to load resource: the server responded with a status of 400 (HTTP/2.0 400) (send, line 0)
  </code></pre>
  
  <p>Which I am assuming is a bad request. What is the correct way to do this?</p>