Ajax DELETE请求

I'm new in the world of AJAX request.

I have a problem talking with an API. I need to make a DELETE request containing a token and an id to delte some data in the database. It works perfectly using postman and it work here when I make the request without sending the data. But when I try to send the data it respond with a 404 error.

I dont' realy understand what's going on.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Admin</title>

    <link rel="stylesheet" href="./style.css">
</head>

<body class="invert">
    <nav class="nav">
        <a href="./index.html" class="title">John Doe</a>
    
        <ul>
            <li>
                <a href="./admin.html" class="active">all</a>
            </li>
    
            <li>
                <a href="./adminCreate.html">New</a>
            </li>
    
            <li>
                <a href="./logout.html">Logout</a>
            </li>
        </ul>
    </nav>

    <main class="dashboard page">
        <div class="container medium">
            <h2>Works</h2>

            <ul class="listItems" id="works">
                <!-- <li>
                        <p>[Titre]</p>
                                    
                        <div class="actions">
                            <a href="./adminEdit.html?[slug]" class="btn outline">Edit</a>
                            <p id="delete" data-id="[_id]" class="btn outline delete">Delete</p>
                        </div>
                </li> -->
            </ul>
        </div>
    </main>

    <script src="./vendors/jquery.js"></script>

    <script>
        // Astuce
        // Pour rediriger vers une autre page, utilisez la commande :
        // window.location.replace('./page.html')

        $(document).ready(function(e){
          
            $works = $('#works')

            $.ajax({
                    type:'GET',
                    url: 'https://wsc-api.herokuapp.com/works',
                    success: function(content){
                    data = content.content;
                        displayData(data);
                        console.log(data)
                }
            });

            function displayData(D){
                let result = D
                const html = result.map(P => {
                    return `
                        <li>
                            <p>${P.title}</p>
                                        
                            <div class="actions">
                                <a href="./adminEdit.html?${P.slug}" class="btn outline">Edit</a>
                                <p id="delete" data-id="${P._id}" class="btn outline delete">Delete</p>
                            </div>
                        </li>
                       `;
                }).join('');
                $works.html(html) ;
            };

            $('#works').on('click', '#delete', function(){
                let id = $(this).data('id')
                let token = sessionStorage.getItem('token');

                 let data = "";
                     data += encodeURIComponent("token")+"="+encodeURIComponent(token)+"&";
                     data += encodeURIComponent("id")+"="+encodeURIComponent(id);
                     console.log(data);

                $.ajax({
                    type:'DELETE',
                    url: 'https://wsc-api.herokuapp.com/works',
                    data: data,
                    ContentType: 'application/x-www-form-urlencoded',
                    success: function(content){
                        $(this).remove();
                        console.log(content)
                    }
                });
            });
        });
            

       



    </script>
</body>
</html>

if anyone has any advise about this code and the way I am doing it it would be wonderful.

Thanks you.

</div>