-
Notifications
You must be signed in to change notification settings - Fork 13
api
chrisgoringe edited this page Apr 11, 2024
·
4 revisions
In your custom node python file...
from server import PromptServer
from aiohttp import web
routes = PromptServer.instance.routes
@routes.post('/a_new_path')
async def my_hander_method(request):
post = await request.post()
x = post.get("something")
return web.json_response({})In the javascript, the code is something like:
function send_message(message) {
const body = new FormData();
body.append('something',message);
api.fetchApi("/a_new_path", { method: "POST", body, });
}