Send Firebase push notification from JavaScript/jQuery
<p>I am trying to send Firebase push notification from my html page to Android app. I am refering <a href="https://stackoverflow.com/a/37845174/4291272">this</a> SO answer to implement it. Here is my code:</p>

<pre><code>function post() {
        $.ajax({
            type : 'POST',
            url : "https://fcm.googleapis.com/fcm/send",
            headers : {
                Authorization : 'key=' + 'xxxxxxxxxxxx-xxx-xxxxxxxxxxxxxx'
            },
            contentType : 'application/json',
            data : {
              "to": "/topics/videos",
              "data": {
                "message": "This is push for video!"
               }
            },
            success : function(response) {
                console.log(response);
            },
            error : function(xhr, status, error) {
                console.log(xhr.error);                   
            }
        }); 
</code></pre>

<p>Currently, I am facing issue that in response of <code>POST request</code> I am getting following error:</p>

<p><strong>JSON_PARSING_ERROR: Unexpected character (t) at position 0.</strong></p>