JSFiddle - React, Tailwind, and code Playground

by gutek

JavaScript

$(function () {

    console.log('in');
    var data = [{
        "eventId": "fbf4a1a1-b4a3-4dfe-a01f-ec52c34e16e4",
  		"eventType": "PonyJumped",
  		"data": {
    		"Pony": "Derpy Hooves",
    		"Height": 10,
    		"Distance": 13
  		}
	}];
    console.dir(data);
    
    $.ajax({
        type: 'POST',
        contentType: 'application/json',
        url: 'http://127.0.0.1:2113/streams/newstream',
        data: data,
        success: function () { alert('ok'); },
        error: function () { alert('dupa'); },
        dataType: 'json'
    });
    
    //$.postJSON('http://127.0.0.1:2113/streams/ponies', data, function () {
    //    alert('ok');
    //});

})();