Send from simple HTTP page a json to aiohttp

Hi mates, I’m trying to figure out myslef but this goes over my knowledge, thank you for help.
The goal is to simply send a json object to a web server written in python which actually uses aiohttp library (all is updated), actually something is wrong and I’m getting “405 method not allowed”.
The page is hosted by smallHTTP server, it contains buttons, buttons should send an http request to a second http server (python) hosted on the same machine. this is what a kind mate suggested me:


    <html lang="it">
    <head>
    	<title> Vespa - Ducati </title>
    	<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    	<meta http-equiv="Content-Style-Type" content="text/css;">
    	<meta name="Author" content="O">
    	<link rel="stylesheet" href="http://192.168.24.2/index.css" type="text/css" media="screen,projection,print">	<!--// Page Style //-->
    	
    </head>
    
    
    <body>
    <div id="e0" class="cc08">
    <a href="#" onclick="setCurrentScene('Vespa127')">
    <img src="logo.jpg" border="0" alt="Logo" title="Logo">
    </a>
    </div>
    
    <script>
    function setCurrentScene(scenename) {
    var url = 'http://192.168.24.2:81/emit/SetCurrentScene';
    var xhr = new XMLHttpRequest();
    xhr.open('POST', url);
    
    xhr.setRequestHeader("Content-Type", "application/json");
    
    xhr.onreadystatechange = function () {
    if (xhr.readyState === 4) {
    console.log(xhr.status);
    console.log(xhr.responseText);
    }
    };
    
    var data = '{"scene-name":"'+scenename+'"}';
    
    xhr.send(data);
    }
    </script>
    </body>
    </html>

The goal of this script is to simulate a request like the following, but by HTTP, and not PHP (which I supose it is).


    curl -XPOST -H "Content-type: application/json" -d '{"scene-name":"Vespa127"}' 'http://192.168.24.2:81/emit/SetCurrentScene'

Sniffing the packets I see the error 405 from server incoming after OPTIONS request (OPTIONS /call/SetCurrentScene HTTP/1.1\r\n) and I don’t have idea if this is because the request is wrong, or missing object, or anything that I can’t understand (
How can I correctly send the object?
Thank s a lot for help!