Python Handler For Reciving Ajax Calls?

This is the ajax req

$.ajax({
            type: "POST",
            url: window.portal_url + '/ajax_call',
            contentType: "application/json",
            data: JSON.stringify(ajaxData),
            success: function(response) {
                console.log("Server response:", response);
                alert(response);
            },
            error: function(xhr, status, error) {
                console.error("Error:", error);
                alert(response);
            }
        });

How the Python script looks for gettting the datas? "request.get"

Read the Plone documentation about "browser views" e.g.

Possibly misreading the post: the answer is for writing a handler for an AJAX request in Plone.

To send a JSON POST request to the backend from a Python script I would either use the requests package or httpx.

If you do not want to install additional package in your Python, you can also use it's built-in urllib.request.